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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-01-20T10:09:34+01:00

core: freeing reply lump list relocated to the file with related functions

---

Modified: src/core/data_lump_rpl.c
Modified: src/core/data_lump_rpl.h
Modified: src/core/parser/msg_parser.c

---

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

---

diff --git a/src/core/data_lump_rpl.c b/src/core/data_lump_rpl.c
index 294b70c4b6a..d1991a3c943 100644
--- a/src/core/data_lump_rpl.c
+++ b/src/core/data_lump_rpl.c
@@ -114,6 +114,17 @@ void free_lump_rpl(struct lump_rpl *lump)
 }
 
 
+void free_reply_lump_list(struct lump_rpl *lump)
+{
+       struct lump_rpl *foo, *bar;
+       for(foo = lump; foo;) {
+               bar = foo->next;
+               free_lump_rpl(foo);
+               foo = bar;
+       }
+}
+
+
 void unlink_lump_rpl(struct sip_msg *msg, struct lump_rpl *lump)
 {
        struct lump_rpl *foo, *prev;
diff --git a/src/core/data_lump_rpl.h b/src/core/data_lump_rpl.h
index ecb57411f76..8a4d289d3a4 100644
--- a/src/core/data_lump_rpl.h
+++ b/src/core/data_lump_rpl.h
@@ -64,6 +64,7 @@ inline static struct lump_rpl *add_lump_rpl(
 
 
 void free_lump_rpl(struct lump_rpl *);
+void free_reply_lump_list(struct lump_rpl *lump);
 
 void unlink_lump_rpl(struct sip_msg *, struct lump_rpl *);
 
diff --git a/src/core/parser/msg_parser.c b/src/core/parser/msg_parser.c
index 13170071bc8..e46631c1f06 100644
--- a/src/core/parser/msg_parser.c
+++ b/src/core/parser/msg_parser.c
@@ -798,17 +798,6 @@ int parse_msg(
 }
 
 
-void free_reply_lump(struct lump_rpl *lump)
-{
-       struct lump_rpl *foo, *bar;
-       for(foo = lump; foo;) {
-               bar = foo->next;
-               free_lump_rpl(foo);
-               foo = bar;
-       }
-}
-
-
 /*only the content*/
 void free_sip_msg(struct sip_msg *const msg)
 {
@@ -827,7 +816,7 @@ void free_sip_msg(struct sip_msg *const msg)
        if(msg->body_lumps)
                free_lump_list(msg->body_lumps);
        if(msg->reply_lump)
-               free_reply_lump(msg->reply_lump);
+               free_reply_lump_list(msg->reply_lump);
        msg_ldata_reset(msg);
        /* no free of msg->buf -- a pointer to a static buffer */
 }

_______________________________________________
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