Skip to content

Commit

Permalink
presence_xml: better error handling to free all allocated vars
Browse files Browse the repository at this point in the history
(cherry picked from commit 2d40e14)
  • Loading branch information
miconda committed May 19, 2015
1 parent 8f324fb commit c468ed2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/presence_xml/pres_check.c
Expand Up @@ -140,7 +140,7 @@ int presxml_check_activities(struct sip_msg *msg, str presentity_uri, str activi
if (presentity == NULL || presentity->len <= 0 || presentity->s == NULL)
{
LM_DBG("cannot get presentity for %.*s\n", presentity_uri.len, presentity_uri.s);
return -1;
goto error;
}

if ((xmlDoc = xmlParseMemory(presentity->s, presentity->len)) == NULL)
Expand Down Expand Up @@ -192,6 +192,7 @@ int presxml_check_activities(struct sip_msg *msg, str presentity_uri, str activi
pkg_free(nodeName);
if (xmlDoc != NULL)
xmlFreeDoc(xmlDoc);
pres_free_presentity(presentity, ev);
if(presentity != NULL)
pres_free_presentity(presentity, ev);
return retval;
}

0 comments on commit c468ed2

Please sign in to comment.