Skip to content

Commit

Permalink
Erlang: Revert breaking change
Browse files Browse the repository at this point in the history
Revert 6542a36
xavp_add_xavp_value returns the root and not the xavp it added and that was the reason for the code the commit removed.  Changed a variable name to help make that more clear.

Also related to #2069.

(cherry picked from commit 1ed58f0)
  • Loading branch information
jvanvleet authored and miconda committed Mar 2, 2022
1 parent 34eceee commit b832920
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/modules/erlang/pv_xbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ sr_xavp_t *xbuff_new(str *name)

if(!xbuffs_root)
{
xbuff = xavp_add_xavp_value(&xbuff_list,name,&xbuff_val,xavp_get_crt_list());
} else {
xbuff = xavp_get_child(&xbuff_list, name);
xbuffs_root = xavp_add_xavp_value(&xbuff_list,name,&xbuff_val,xavp_get_crt_list());
if (!xbuffs_root){
LM_ERR("cannot create xbuffs_root \n");
return NULL;
}
}

xbuff = xavp_get_child(&xbuff_list, name);

if (!xbuff) {

xbuff_val.type = SR_XTYPE_NULL;
Expand Down

0 comments on commit b832920

Please sign in to comment.