Module: kamailio
Branch: master
Commit: 458d40eb9cb202a18724062ffd0ea455e4d75d6d
URL:
https://github.com/kamailio/kamailio/commit/458d40eb9cb202a18724062ffd0ea45…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/458d40eb9cb202a18724062ffd0ea45…
Patch:
https://github.com/kamailio/kamailio/commit/458d40eb9cb202a18724062ffd0ea45…
---
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) {