Module: kamailio
Branch: 4.2
Commit: b103dff88f4ac83acf20798c06d43b2586810a36
URL:
https://github.com/kamailio/kamailio/commit/b103dff88f4ac83acf20798c06d43b2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-05-19T09:29:25+02:00
regex: reset pointer after free to avoid double free if an error occurs
(cherry picked from commit 379667e878c9e0795998f600edbcbb3974846f71)
---
Modified: modules/regex/regex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b103dff88f4ac83acf20798c06d43b2…
Patch:
https://github.com/kamailio/kamailio/commit/b103dff88f4ac83acf20798c06d43b2…
---
diff --git a/modules/regex/regex_mod.c b/modules/regex/regex_mod.c
index 59cd566..5b8b5cc 100644
--- a/modules/regex/regex_mod.c
+++ b/modules/regex/regex_mod.c
@@ -418,6 +418,7 @@ static int load_pcres(int action)
memcpy(pcres_tmp[i], pcre_tmp, pcre_size);
pcre_free(pcre_tmp);
pkg_free(patterns[i]);
+ patterns[i] = NULL;
}
/* Copy to shared memory */