Module: kamailio
Branch: 4.3
Commit: 5304da51e32ba79dbe6bdd60d848c4d4f5afd9bd
URL:
https://github.com/kamailio/kamailio/commit/5304da51e32ba79dbe6bdd60d848c4d…
Author: Charles Chance <charles.chance(a)sipcentric.com>
Committer: Charles Chance <charles.chance(a)sipcentric.com>
Date: 2015-07-16T20:25:30+01:00
dmq_usrloc: don't destroy json doc before we're done with it.
(cherry picked from commit 99f7d67b20c011e78c277a44ea8cd4d6a820806f)
---
Modified: modules/dmq_usrloc/usrloc_sync.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5304da51e32ba79dbe6bdd60d848c4d…
Patch:
https://github.com/kamailio/kamailio/commit/5304da51e32ba79dbe6bdd60d848c4d…
---
diff --git a/modules/dmq_usrloc/usrloc_sync.c b/modules/dmq_usrloc/usrloc_sync.c
index e68949c..7d1cf45 100644
--- a/modules/dmq_usrloc/usrloc_sync.c
+++ b/modules/dmq_usrloc/usrloc_sync.c
@@ -328,7 +328,6 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp,
dmq_node_t*
LM_ERR("unrecognized field in json object\n");
}
}
- srjson_DestroyDoc(&jdoc);
memset( &ci, 0, sizeof(ucontact_info_t));
ci.ruid = ruid;
ci.c = &c;
@@ -367,16 +366,19 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, peer_reponse_t* resp,
dmq_node_t*
default: goto invalid;
}
+ srjson_DestroyDoc(&jdoc);
resp->reason = dmq_200_rpl;
resp->resp_code = 200;
return 0;
invalid:
+ srjson_DestroyDoc(&jdoc);
resp->reason = dmq_400_rpl;
resp->resp_code = 400;
return 0;
error:
+ srjson_DestroyDoc(&jdoc);
resp->reason = dmq_500_rpl;
resp->resp_code = 500;
return 0;