Module: kamailio
Branch: master
Commit: b86030cfbd66ba95f33f312595edae29e2b5cde0
URL: 
https://github.com/kamailio/kamailio/commit/b86030cfbd66ba95f33f312595edae29e2b5cde0

Author: Victor Seva <[email protected]>
Committer: Victor Seva <[email protected]>
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/b86030cfbd66ba95f33f312595edae29e2b5cde0.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b86030cfbd66ba95f33f312595edae29e2b5cde0.patch

---

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

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to