Module: kamailio
Branch: 6.0
Commit: 89d8c01de118964f527b899a7ffcff250fb7085e
URL: 
https://github.com/kamailio/kamailio/commit/89d8c01de118964f527b899a7ffcff250fb7085e

Author: Victor Seva <[email protected]>
Committer: Victor Seva <[email protected]>
Date: 2026-05-04T11:12:17+02:00

ims_ipsec_pcscf: Fix problems with double mem free, take two

related #4670

(cherry picked from commit d6e94a640097f31e14df652b039f017a90f20872)
(cherry picked from commit e47d4792de562b767d0796662525da902b270df3)

---

Modified: src/modules/ims_ipsec_pcscf/sec_agree.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/89d8c01de118964f527b899a7ffcff250fb7085e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/89d8c01de118964f527b899a7ffcff250fb7085e.patch

---

diff --git a/src/modules/ims_ipsec_pcscf/sec_agree.c 
b/src/modules/ims_ipsec_pcscf/sec_agree.c
index 1b977e9c2d6..ee10748c30a 100644
--- a/src/modules/ims_ipsec_pcscf/sec_agree.c
+++ b/src/modules/ims_ipsec_pcscf/sec_agree.c
@@ -290,7 +290,8 @@ static security_t *parse_sec_agree(struct hdr_field *h)
        // Function - free_security()
        // Keep them in sync!
        if(params) {
-               shm_free(params->sec_header.s);
+               if(params->sec_header.s)
+                       shm_free(params->sec_header.s);
 
                if(params->type == SECURITY_IPSEC && params->data.ipsec) {
                        if(params->data.ipsec->ealg.s)

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to