Module: sip-router
Branch: master
Commit: 1ccdadc89cdf5ddab069e4c912a9b6834c6631f1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1ccdadc…
Author: Jason Penton <jason.penton(a)gmail.com>
Committer: Jason Penton <jason.penton(a)gmail.com>
Date: Mon Mar 10 19:48:10 2014 +0200
parser/msg_parser: corrected freeing of msg. w.r.t path vecor
- now use FL_SHM_CLONE internal msg flag to decide whether or not to pkg free path_vec
---
parser/msg_parser.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/parser/msg_parser.c b/parser/msg_parser.c
index f430b3f..fbd4ddb 100644
--- a/parser/msg_parser.c
+++ b/parser/msg_parser.c
@@ -830,15 +830,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->path_vec.s && likely(msg->path_vec.s >= msg->buf &&
(msg->path_vec.s < (msg->buf + msg->len)))) {
+ if (!(msg->msg_flags&FL_SHM_CLONE)) {
pkg_free(msg->path_vec.s);
- } else {
- if (msg->path_vec.s)
- /* don't reset path_vec if it is shm */
- return;
+ msg->path_vec.s = 0;
+ msg->path_vec.len = 0;
}
- msg->path_vec.s = 0;
- msg->path_vec.len = 0;
}