[sr-dev] git:master:5e58d48c: rls: rls_get_service_list() - set to NULL the content of rootdoc pointer

Daniel-Constantin Mierla miconda at gmail.com
Mon Jan 22 08:42:23 CET 2018


Module: kamailio
Branch: master
Commit: 5e58d48c980f5e413f47271dd342ee0630722bbb
URL: https://github.com/kamailio/kamailio/commit/5e58d48c980f5e413f47271dd342ee0630722bbb

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-01-21T13:17:46+01:00

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

---

Modified: src/modules/rls/subscribe.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5e58d48c980f5e413f47271dd342ee0630722bbb.diff
Patch: https://github.com/kamailio/kamailio/commit/5e58d48c980f5e413f47271dd342ee0630722bbb.patch

---

diff --git a/src/modules/rls/subscribe.c b/src/modules/rls/subscribe.c
index c895bd1a93..9222dc72b8 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);
 




More information about the sr-dev mailing list