Module: sip-router
Branch: kamailio_3.0
Commit: 61f4d7f12723c4a3d989d37a414433e5ed71abff
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=61f4d7f…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
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.
---
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;
}