Module: kamailio
Branch: master
Commit: 1ed58f0de4f7a3ab3a81dd84c1c3b94fa1df2c4b
URL:
https://github.com/kamailio/kamailio/commit/1ed58f0de4f7a3ab3a81dd84c1c3b94…
Author: James Van Vleet <james(a)vanvleet.net>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-02-18T15:40:04+01:00
Erlang: Revert breaking change
Revert
https://github.com/kamailio/kamailio/commit/6542a367638ec5f8a2b62994f8c309e…
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
https://github.com/kamailio/kamailio/issues/2069.
---
Modified: src/modules/erlang/pv_xbuff.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1ed58f0de4f7a3ab3a81dd84c1c3b94…
Patch:
https://github.com/kamailio/kamailio/commit/1ed58f0de4f7a3ab3a81dd84c1c3b94…
---
diff --git a/src/modules/erlang/pv_xbuff.c b/src/modules/erlang/pv_xbuff.c
index 894c36784c..b19a22ac8e 100644
--- a/src/modules/erlang/pv_xbuff.c
+++ b/src/modules/erlang/pv_xbuff.c
@@ -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;