Browse code

core: safety check for linker when inserting xavp with index

Daniel-Constantin Mierla authored on 14/05/2015 17:16:26
Showing 1 changed files
... ...
@@ -732,6 +732,10 @@ int xavp_insert(sr_xavp_t *xavp, int idx, sr_xavp_t **list)
732 732
 		lst = crt;
733 733
 	}
734 734
 
735
+	if(lst==NULL) {
736
+		LM_ERR("cannot link the xavp\n");
737
+		return -1;
738
+	}
735 739
 	xavp->next = lst->next;
736 740
 	lst->next = xavp;
737 741