From 730fad39599c39b1a5c3faa1d9bb9c49db61439b Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Sun, 21 Jan 2018 13:17:46 +0100 Subject: [PATCH] rls: rls_get_service_list() - set to NULL the content of rootdoc pointer - its a function parameter and expects to be set by the function (cherry picked from commit 5e58d48c980f5e413f47271dd342ee0630722bbb) --- src/modules/rls/subscribe.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/rls/subscribe.c b/src/modules/rls/subscribe.c index c895bd1a93f..9222dc72b87 100644 --- a/src/modules/rls/subscribe.c +++ b/src/modules/rls/subscribe.c @@ -272,12 +272,10 @@ int rls_get_service_list(str *service_uri, str *user, str *domain, LM_DBG("service uri %.*s not found in rl document for user" " sip:%.*s@%.*s\n", service_uri->len, service_uri->s, user->len, user->s, domain->len, domain->s); - rootdoc = NULL; if(xmldoc!=NULL) xmlFreeDoc(xmldoc); - } - else - { + *rootdoc = NULL; + } else { *rootdoc = xmldoc; } @@ -290,8 +288,6 @@ int rls_get_service_list(str *service_uri, str *user, str *domain, error: if(result!=NULL) rls_xcap_dbf.free_result(rls_xcap_db, result); - if(xmldoc!=NULL) - xmlFreeDoc(xmldoc); if(xcapdoc!=NULL) pkg_free(xcapdoc);