[sr-dev] git:master:13ff91b1: htable: earlier init of jdoc used for dmq for proper clean on error cases

Daniel-Constantin Mierla miconda at gmail.com
Fri Oct 28 16:09:51 CEST 2016


Module: kamailio
Branch: master
Commit: 13ff91b1955d7248f8aaaf350675275e425443dc
URL: https://github.com/kamailio/kamailio/commit/13ff91b1955d7248f8aaaf350675275e425443dc

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-10-28T16:09:40+02:00

htable: earlier init of jdoc used for dmq for proper clean on error cases

---

Modified: modules/htable/ht_dmq.c

---

Diff:  https://github.com/kamailio/kamailio/commit/13ff91b1955d7248f8aaaf350675275e425443dc.diff
Patch: https://github.com/kamailio/kamailio/commit/13ff91b1955d7248f8aaaf350675275e425443dc.patch

---

diff --git a/modules/htable/ht_dmq.c b/modules/htable/ht_dmq.c
index a88bad4..0983f61 100644
--- a/modules/htable/ht_dmq.c
+++ b/modules/htable/ht_dmq.c
@@ -104,6 +104,8 @@ int ht_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq
 	/* received dmq message */
 	LM_DBG("dmq message received\n");
 
+	srjson_InitDoc(&jdoc, NULL);
+
 	if(!msg->content_length) {
 		LM_ERR("no content length header found\n");
 		goto invalid;
@@ -125,7 +127,6 @@ int ht_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp, dmq_node_t* dmq
 	/* 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