Skip to content

Commit

Permalink
core: skip abort() in free_lump() for LUMPFLAG_DUPED
Browse files Browse the repository at this point in the history
- the LUMPFLAG_DUPED is set when duplicating lumps list for branch route
execution, but some functions such as set_body() may want to clean them
- report and minimal reproducing config by Henning Westerholt

(cherry picked from commit 57ee97f)
  • Loading branch information
miconda authored and henningw committed Sep 9, 2020
1 parent 4e0f9f8 commit 2ca2232
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/data_lump.c
Expand Up @@ -456,14 +456,17 @@ struct lump* anchor_lump2(struct sip_msg* msg, int offset, int len,
}


/**
* free lump content
*/
void free_lump(struct lump* lmp)
{
if (lmp && (lmp->op==LUMP_ADD)){
if (lmp->u.value){
if (lmp->flags &(LUMPFLAG_DUPED|LUMPFLAG_SHMEM)){
if (lmp && (lmp->op==LUMP_ADD)) {
if (lmp->u.value) {
if (lmp->flags & LUMPFLAG_SHMEM) {
LM_CRIT("non free-able lump: %p flags=%x\n", lmp, lmp->flags);
abort();
}else{
} else if(!(lmp->flags & LUMPFLAG_DUPED)) {
pkg_free(lmp->u.value);
lmp->u.value=0;
lmp->len=0;
Expand Down

0 comments on commit 2ca2232

Please sign in to comment.