Module: kamailio Branch: master Commit: b86030cfbd66ba95f33f312595edae29e2b5cde0 URL: https://github.com/kamailio/kamailio/commit/b86030cfbd66ba95f33f312595edae29...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2024-07-18T13:41:15+02:00
regex: remove pcre2_free() warning
related to #3851
---
Modified: src/modules/regex/regex_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/b86030cfbd66ba95f33f312595edae29... Patch: https://github.com/kamailio/kamailio/commit/b86030cfbd66ba95f33f312595edae29...
---
diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c index 52ed60b295c..f4e93e48a3e 100644 --- a/src/modules/regex/regex_mod.c +++ b/src/modules/regex/regex_mod.c @@ -170,8 +170,10 @@ static void *pcre2_malloc(size_t size, void *ext)
static void pcre2_free(void *ptr, void *ext) { - shm_free(ptr); - ptr = NULL; + if(ptr) { + shm_free(ptr); + ptr = NULL; + } }
/*! \brief