[sr-dev] git:master:4a1293f3: json: free pv in case of failure inside json_tr_eval()

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


Module: kamailio
Branch: master
Commit: 4a1293f38b75bcf63fbd2a7ee4410d3b10d1f6a7
URL: https://github.com/kamailio/kamailio/commit/4a1293f38b75bcf63fbd2a7ee4410d3b10d1f6a7

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

json: free pv in case of failure inside json_tr_eval()

---

Modified: src/modules/json/json_trans.c

---

Diff:  https://github.com/kamailio/kamailio/commit/4a1293f38b75bcf63fbd2a7ee4410d3b10d1f6a7.diff
Patch: https://github.com/kamailio/kamailio/commit/4a1293f38b75bcf63fbd2a7ee4410d3b10d1f6a7.patch

---

diff --git a/src/modules/json/json_trans.c b/src/modules/json/json_trans.c
index 4287d692a3..e200ef7084 100644
--- a/src/modules/json/json_trans.c
+++ b/src/modules/json/json_trans.c
@@ -282,11 +282,13 @@ int json_tr_eval(
 					LM_ERR("cannot get spve_value from TR_PARAM_STRING : "
 						   "%.*s\n",
 							tp->v.s.len, tp->v.s.s);
+					pkg_free(pv);
 					return -1;
 				}
 				if(fixup_get_svalue(msg, (gparam_p)v1, &v2) != 0) {
 					LM_ERR("cannot get value from TR_PARAM_STRING\n");
 					fixup_free_spve_null(&v1, 1);
+					pkg_free(pv);
 					return -1;
 				}
 				fixup_free_spve_null(&v1, 1);




More information about the sr-dev mailing list