Module: kamailio
Branch: 5.8
Commit: 1946e35c4d144fba3067d3fee5d1bd030dc4a609
URL:
https://github.com/kamailio/kamailio/commit/1946e35c4d144fba3067d3fee5d1bd0…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-07-18T13:42:31+02:00
regex: remove pcre2_free() warning
related to #3851
(cherry picked from commit b86030cfbd66ba95f33f312595edae29e2b5cde0)
---
Modified: src/modules/regex/regex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1946e35c4d144fba3067d3fee5d1bd0…
Patch:
https://github.com/kamailio/kamailio/commit/1946e35c4d144fba3067d3fee5d1bd0…
---
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