Browse code

pv: return false if pv_unset() fails

(cherry picked from commit ce745f3837a668b67506bfd404c7ef619936de7a)

Daniel-Constantin Mierla authored on 06/11/2016 21:55:11
Showing 1 changed files
... ...
@@ -569,7 +569,7 @@ static int mod_init(void)
569 569
 	{
570 570
 		LM_ERR("failed to register RPC commands\n");
571 571
 		return -1;
572
-    }
572
+	}
573 573
 	pv_init_sbranch();
574 574
 
575 575
 	return 0;
... ...
@@ -612,7 +612,10 @@ static int pv_unset(struct sip_msg* msg, char* pvid, char *foo)
612 612
 	pv_spec_t *sp;
613 613
 	
614 614
 	sp = (pv_spec_t*)pvid;
615
-	pv_set_spec_value(msg, sp, 0, NULL);
615
+	if(pv_set_spec_value(msg, sp, 0, NULL)<0) {
616
+		LM_ERR("faile to unset variable\n");
617
+		return -1;
618
+	}
616 619
 
617 620
 	return 1;
618 621
 }