Module: kamailio
Branch: 4.2
Commit: 74888e44aa4db53a3e8db49d848af97d460f7e1f
URL:
https://github.com/kamailio/kamailio/commit/74888e44aa4db53a3e8db49d848af97…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-01-15T20:14:41+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
(cherry picked from commit 1fd0ca99eaa4b2c5cfcb8bd555a35088ddf49343)
---
Modified: data_lump.c
---
Diff:
https://github.com/kamailio/kamailio/commit/74888e44aa4db53a3e8db49d848af97…
Patch:
https://github.com/kamailio/kamailio/commit/74888e44aa4db53a3e8db49d848af97…
---
diff --git a/data_lump.c b/data_lump.c
index 5faee6f..6beb93f 100644
--- a/data_lump.c
+++ b/data_lump.c
@@ -709,6 +709,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;
@@ -733,7 +738,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;