Browse code

core: safety check for linker when inserting xavp with index

(cherry picked from commit ec438b45696e17af0a3b19bb7ac12b221f897517)

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