Skip to content

Commit

Permalink
presence_conference: free xml array in case of error
Browse files Browse the repository at this point in the history
(cherry picked from commit 9c34b68)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent 6309880 commit 4335647
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/presence_conference/notify_body.c
Expand Up @@ -92,7 +92,7 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n, in
xmlNsPtr namespace = NULL;

xmlNodePtr p_root= NULL;
xmlDocPtr* xml_array ;
xmlDocPtr* xml_array = NULL ;
xmlNodePtr node = NULL;
str *body= NULL;
char buf[MAX_URI_SIZE+1];
Expand Down Expand Up @@ -129,8 +129,7 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n, in

if(j == 0) /* no body */
{
if(xml_array)
pkg_free(xml_array);
pkg_free(xml_array);
return NULL;
}

Expand All @@ -142,7 +141,7 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n, in
/* create the new NOTIFY body */
if ( (pres_user->len + pres_domain->len + 1) > MAX_URI_SIZE ) {
LM_ERR("entity URI too long, maximum=%d\n", MAX_URI_SIZE);
return NULL;
goto error;
}
memcpy(buf, pres_user->s, pres_user->len);
buf[pres_user->len] = '@';
Expand Down

0 comments on commit 4335647

Please sign in to comment.