Skip to content

Commit

Permalink
ims_registrar_pcscf: go to error to free variables on failure cases
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Oct 10, 2022
1 parent d39f12c commit 609962b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/ims_registrar_pcscf/ul_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ str* build_reginfo_partial(ppublic_t *impu, struct pcontact* c, int type) {
doc = xmlNewDoc(BAD_CAST "1.0");
if (doc == 0) {
LM_ERR("Unable to create XML-Doc\n");
return NULL;
goto error;
}

root_node = xmlNewNode(NULL, BAD_CAST "reginfo");
if (root_node == 0) {
LM_ERR("Unable to create reginfo-XML-Element\n");
return NULL;
goto error;
}
/* This is our Root-Element: */
xmlDocSetRootElement(doc, root_node);
Expand Down Expand Up @@ -157,7 +157,7 @@ str* build_reginfo_partial(ppublic_t *impu, struct pcontact* c, int type) {
body = (str*) pkg_malloc(sizeof(str));
if (body == NULL) {
LM_ERR("while allocating memory\n");
return NULL;
goto error;
}
memset(body, 0, sizeof(str));

Expand Down

0 comments on commit 609962b

Please sign in to comment.