Module: kamailio
Branch: master
Commit: 379667e878c9e0795998f600edbcbb3974846f71
URL:
https://github.com/kamailio/kamailio/commit/379667e878c9e0795998f600edbcbb3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-05-14T13:01:18+02:00
regex: reset pointer after free to avoid double free if an error occurs
---
Modified: modules/regex/regex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/379667e878c9e0795998f600edbcbb3…
Patch:
https://github.com/kamailio/kamailio/commit/379667e878c9e0795998f600edbcbb3…
---
diff --git a/modules/regex/regex_mod.c b/modules/regex/regex_mod.c
index 35eeca0..394a9e7 100644
--- a/modules/regex/regex_mod.c
+++ b/modules/regex/regex_mod.c
@@ -411,6 +411,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 */