[sr-dev] git:master:cca31b30: core: parser reset_path_vector() remove check for msg->msg_flags

Victor Seva linuxmaniac at torreviejawireless.org
Fri Jun 2 10:34:32 CEST 2017


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

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2017-06-02T10:19:25+02:00

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

---

Modified: src/core/parser/msg_parser.c

---

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

---

diff --git a/src/core/parser/msg_parser.c b/src/core/parser/msg_parser.c
index e8c990da9f..2a4f2bb593 100644
--- a/src/core/parser/msg_parser.c
+++ b/src/core/parser/msg_parser.c
@@ -799,13 +799,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;
 }
 
 




More information about the sr-dev mailing list