[sr-dev] git:master:0c93efec: core: free resources in xavp_clone_level_nodata

Henning Westerholt henningw at users.noreply.github.com
Sat Mar 9 12:52:51 CET 2019


Module: kamailio
Branch: master
Commit: 0c93efec739551f3e74e119d4b789d0bb6e766d6
URL: https://github.com/kamailio/kamailio/commit/0c93efec739551f3e74e119d4b789d0bb6e766d6

Author: lazedo <luis.azedo at factorlusitano.com>
Committer: Henning Westerholt <henningw at 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/0c93efec739551f3e74e119d4b789d0bb6e766d6.diff
Patch: https://github.com/kamailio/kamailio/commit/0c93efec739551f3e74e119d4b789d0bb6e766d6.patch

---

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)




More information about the sr-dev mailing list