Module: kamailio
Branch: 5.2
Commit: f406266966b68fff9493c62ac5c9ccc5b8237e6b
URL:
https://github.com/kamailio/kamailio/commit/f406266966b68fff9493c62ac5c9ccc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-15T12:47:51+02:00
siptrace: fix memory leak on sip trace function with dst uri
---
Modified: src/modules/siptrace/siptrace.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f406266966b68fff9493c62ac5c9ccc…
Patch:
https://github.com/kamailio/kamailio/commit/f406266966b68fff9493c62ac5c9ccc…
---
diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 521ff113ab..08ddc07ef5 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -709,6 +709,7 @@ static int ki_sip_trace_dst_cid(sip_msg_t *msg, str *duri, str *cid)
dest_info_t *dst = NULL;
sip_uri_t uri;
proxy_l_t *p = NULL;
+ int ret = 1;
// If the dest is empty, use the module parameter, if set
if(duri == NULL || duri->len <= 0) {
@@ -750,7 +751,11 @@ static int ki_sip_trace_dst_cid(sip_msg_t *msg, str *duri, str *cid)
pkg_free(p);
}
- return sip_trace(msg, dst, ((cid!=NULL && cid->len>0)?cid:NULL), NULL);
+ ret = sip_trace(msg, dst, ((cid!=NULL && cid->len>0)?cid:NULL), NULL);
+
+ pkg_free(dst);
+
+ return ret;
}
/**