[sr-dev] git:master:1fd0ca99: core: remove_lump() clears its innner before/after lists

Daniel-Constantin Mierla miconda at gmail.com
Thu Jan 15 14:30:47 CET 2015


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-01-15T13:42:13+01:00

core: remove_lump() clears its innner before/after lists

- fixing leak issues that could be created by using sl_forward_reply()
  in config file

---

Modified: data_lump.c

---

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

---

diff --git a/data_lump.c b/data_lump.c
index a47ae5a..daab9aa 100644
--- a/data_lump.c
+++ b/data_lump.c
@@ -698,6 +698,11 @@ unsigned int count_applied_lumps(struct lump *ll, int type)
 	return n;
 }
 
+/**
+ * remove a lump in a root list
+ * - it doesn't look for lumps added as before/after rule
+ * - destroys the entire lump, with associated before/after rules
+ */
 int remove_lump(sip_msg_t *msg, struct lump *l)
 {
 	struct lump *t = NULL;
@@ -722,7 +727,9 @@ int remove_lump(sip_msg_t *msg, struct lump *l)
 		} else {
 			prev->next = t->next;
 		}
-		free_lump(t);
+		/* detach and free all its content */
+		t->next = NULL;
+		free_lump_list(t);
 		return 1;
 	}
 	return 0;




More information about the sr-dev mailing list