Module: kamailio
Branch: master
Commit: 0c93efec739551f3e74e119d4b789d0bb6e766d6
URL:
https://github.com/kamailio/kamailio/commit/0c93efec739551f3e74e119d4b789d0…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Henning Westerholt <henningw(a)users.noreply.github.com>
Date: 2019-03-09T12:52:43+01:00
core: free resources in xavp_clone_level_nodata
---
Modified: src/core/xavp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0c93efec739551f3e74e119d4b789d0…
Patch:
https://github.com/kamailio/kamailio/commit/0c93efec739551f3e74e119d4b789d0…
---
diff --git a/src/core/xavp.c b/src/core/xavp.c
index 2c725e92ee..2fd5aaec49 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -714,14 +714,11 @@ sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold)
if(navp==NULL)
{
LM_ERR("cannot create cloned embedded xavp\n");
- if(xnew->val.v.xavp == NULL)
- {
- shm_free(xnew);
- return NULL;
- } else {
- xavp_destroy_list(&navp);
- return NULL;
+ if(xnew->val.v.xavp != NULL) {
+ xavp_destroy_list(&xnew->val.v.xavp);
}
+ shm_free(xnew);
+ return NULL;
}
LM_DBG("cloned inner xavp [%.*s]\n", oavp->name.len, oavp->name.s);
if(xnew->val.v.xavp == NULL)