Skip to content

Commit

Permalink
core: proper cloning of xavp list with no-data type
Browse files Browse the repository at this point in the history
- function used for cloning xavps stored in location record
- reported by Luca Mularoni

(cherry picked from commit 4efb386)
  • Loading branch information
miconda committed Jul 14, 2015
1 parent 8c597a0 commit f5d11d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xavp.c
Expand Up @@ -641,6 +641,7 @@ sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold)
LM_ERR("cannot create cloned root xavp\n");
return NULL;
}
LM_DBG("cloned root xavp [%.*s]\n", xold->name.len, xold->name.s);

if(xold->val.type!=SR_XTYPE_XAVP)
{
Expand All @@ -667,15 +668,16 @@ sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold)
return NULL;
}
}
LM_DBG("cloned inner xavp [%.*s]\n", oavp->name.len, oavp->name.s);
if(xnew->val.v.xavp == NULL)
{
/* link to val in head xavp */
xnew->val.v.xavp = navp;
pavp = navp;
} else {
/* link to prev xavp in the list */
pavp->next = navp;
}
pavp = navp;
}
oavp = oavp->next;
}
Expand Down

0 comments on commit f5d11d1

Please sign in to comment.