|
@@ -698,6 +698,11 @@ unsigned int count_applied_lumps(struct lump *ll, int type)
|
|
return n;
|
|
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)
|
|
int remove_lump(sip_msg_t *msg, struct lump *l)
|
|
{
|
|
{
|
|
struct lump *t = NULL;
|
|
struct lump *t = NULL;
|
|
@@ -722,7 +727,9 @@ int remove_lump(sip_msg_t *msg, struct lump *l)
|
|
} else {
|
|
} else {
|
|
prev->next = t->next;
|
|
prev->next = t->next;
|
|
}
|
|
}
|
|
- free_lump(t);
|
|
|
|
|
|
+ /* detach and free all its content */
|
|
|
|
+ t->next = NULL;
|
|
|
|
+ free_lump_list(t);
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|