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

Author: Alex Hermann <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2026-03-13T09:50:01+01:00

rtpengine: Fix memory leak due to overwriting nodes

idx should not get reset within the outer loop as it will cause overwriting
of earlier nodes and leaking their mem.

---

Modified: src/modules/rtpengine/rtpengine.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/80ae09ba669f5dba3b02a91c0ef19934843ee412.diff
Patch: 
https://github.com/kamailio/kamailio/commit/80ae09ba669f5dba3b02a91c0ef19934843ee412.patch

---

diff --git a/src/modules/rtpengine/rtpengine.c 
b/src/modules/rtpengine/rtpengine.c
index 62a6d6b7348..127de389cbf 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -4091,7 +4091,7 @@ static void rtpengine_ping_check_timer(unsigned int 
ticks, void *param)
        for(rtpp_list = rtpp_set_list->rset_first; rtpp_list != NULL;
                        rtpp_list = rtpp_list->rset_next) {
                lock_get(rtpp_list->rset_lock);
-               for(crt_rtpp = rtpp_list->rn_first, idx = 0;
+               for(crt_rtpp = rtpp_list->rn_first;
                                crt_rtpp != NULL && idx < total_nodes;
                                crt_rtpp = crt_rtpp->rn_next, idx++) {
                        nodes[idx] = *crt_rtpp;

_______________________________________________
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