Module: sip-router
Branch: sr_3.0
Commit: 3ba5c5d3574b35fae31d1f029e8b77a53120c84b
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3ba5c5d…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Sep 22 18:35:37 2010 +0300
modules_k/regex Fixed a memory leak when using pcre regex
The compiled regular expression when using pcre_match was not freed.
(cherry picked from commit 61f4d7f12723c4a3d989d37a414433e5ed71abff)
---
modules_k/regex/regex_mod.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules_k/regex/regex_mod.c b/modules_k/regex/regex_mod.c
index fcefa51..3610646 100644
--- a/modules_k/regex/regex_mod.c
+++ b/modules_k/regex/regex_mod.c
@@ -575,9 +575,10 @@ static int w_pcre_match(struct sip_msg* _msg, char* _s1, char* _s2)
LM_DBG("matching error '%d'\n", pcre_rc);
break;
}
+ pcre_free(pcre_re);
return -1;
}
-
+ pcre_free(pcre_re);
LM_DBG("'%s' matches '%s'\n", string.s, regex.s);
return 1;
}