TT#14580 core: fix memory leak

* sipwise/tm-deep-cloning-of-the-request-for-fake-environment.patch
  introduced a memory leak on reset_path_vector()

Change-Id: Iec8341920e54c769fdc6107765d9a6401a3f64b0
changes/26/13626/1
Victor Seva 8 years ago
parent baa283ce55
commit ad82b828b1

@ -54,5 +54,6 @@ sipwise/sca-fix-sca_call_info_update-params.patch
sipwise/sca-use-onhold_bflag-value-only-when-set.patch
##
sipwise/tm-deep-cloning-of-the-request-for-fake-environment.patch
sipwise/core-parser-reset_path_vector-remove-check-for-msg-m.patch
sipwise/pv_trans_eval_uri.patch
sipwise/rtpengine-mos-stats.patch

@ -0,0 +1,32 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Fri, 2 Jun 2017 10:19:25 +0200
Subject: core: parser reset_path_vector() remove check for msg->msg_flags
* tm now uses shared memory for fake_req() so faked_req->path_vec
was leaking
---
parser/msg_parser.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/parser/msg_parser.c b/parser/msg_parser.c
index 8b21178..c1df41b 100644
--- a/parser/msg_parser.c
+++ b/parser/msg_parser.c
@@ -790,13 +790,11 @@ int set_path_vector(struct sip_msg* msg, str* path)
void reset_path_vector(struct sip_msg* const msg)
{
- /* only free path vector from pkg IFF it is still in pkg... - ie. if msg is shm we don't free... */
- if (!(msg->msg_flags&FL_SHM_CLONE)) {
- if (msg->path_vec.s)
- pkg_free(msg->path_vec.s);
- msg->path_vec.s = 0;
- msg->path_vec.len = 0;
+ if (msg->path_vec.s) {
+ pkg_free(msg->path_vec.s);
}
+ msg->path_vec.s = 0;
+ msg->path_vec.len = 0;
}
Loading…
Cancel
Save