[sr-dev] git:master:458d40eb: presence: dmq - init jdoc var earlier for proper cleanup in case of errors

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 19 08:51:14 CEST 2018


Module: kamailio
Branch: master
Commit: 458d40eb9cb202a18724062ffd0ea455e4d75d6d
URL: https://github.com/kamailio/kamailio/commit/458d40eb9cb202a18724062ffd0ea455e4d75d6d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-06-19T08:22:58+02:00

presence: dmq - init jdoc var earlier for proper cleanup in case of errors

---

Modified: src/modules/presence/presence_dmq.c

---

Diff:  https://github.com/kamailio/kamailio/commit/458d40eb9cb202a18724062ffd0ea455e4d75d6d.diff
Patch: https://github.com/kamailio/kamailio/commit/458d40eb9cb202a18724062ffd0ea455e4d75d6d.patch

---

diff --git a/src/modules/presence/presence_dmq.c b/src/modules/presence/presence_dmq.c
index 4cba168a55..9ce259eeaa 100644
--- a/src/modules/presence/presence_dmq.c
+++ b/src/modules/presence/presence_dmq.c
@@ -236,6 +236,7 @@ int pres_dmq_handle_msg(
 	}
 
 	*pres_dmq_recv = 1;
+	srjson_InitDoc(&jdoc, NULL);
 
 	if(!msg->content_length) {
 		LM_ERR("no content length header found\n");
@@ -258,7 +259,6 @@ int pres_dmq_handle_msg(
 	/* parse body */
 	LM_DBG("body: %.*s\n", body.len, body.s);
 
-	srjson_InitDoc(&jdoc, NULL);
 	jdoc.buf = body;
 
 	if(jdoc.root == NULL) {




More information about the sr-dev mailing list