Browse code

core: fixed xavp level cloning function

- new function introduced recently for usrloc usage

Daniel-Constantin Mierla authored on 28/12/2012 21:17:03
Showing 1 changed files
... ...
@@ -549,7 +549,9 @@ sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold)
549 549
 	sr_xavp_t *pavp = NULL;
550 550
 
551 551
 	if(xold == NULL)
552
+	{
552 553
 		return NULL;
554
+	}
553 555
 	if(xold->val.type==SR_XTYPE_DATA)
554 556
 	{
555 557
 		LM_INFO("xavp value type is 'data' - ignoring in clone\n");
... ...
@@ -563,18 +565,21 @@ sr_xavp_t *xavp_clone_level_nodata(sr_xavp_t *xold)
563 563
 	}
564 564
 
565 565
 	if(xold->val.type!=SR_XTYPE_XAVP)
566
+	{
566 567
 		return xnew;
568
+	}
567 569
 
568 570
 	xnew->val.v.xavp = NULL;
569 571
 	oavp = xold->val.v.xavp;
570 572
 
571 573
 	while(oavp)
572 574
 	{
573
-		if(xold->val.type!=SR_XTYPE_DATA && xold->val.type!=SR_XTYPE_XAVP)
575
+		if(oavp->val.type!=SR_XTYPE_DATA && oavp->val.type!=SR_XTYPE_XAVP)
574 576
 		{
575 577
 			navp =  xavp_new_value(&oavp->name, &oavp->val);
576 578
 			if(navp==NULL)
577 579
 			{
580
+				LM_ERR("cannot create cloned embedded xavp\n");
578 581
 				if(xnew->val.v.xavp == NULL)
579 582
 				{
580 583
 					shm_free(xnew);