Browse Source

core: safety check for linker when inserting xavp with index

Daniel-Constantin Mierla 10 năm trước cách đây
mục cha
commit
ec438b4569
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      xavp.c

+ 4 - 0
xavp.c

@@ -732,6 +732,10 @@ int xavp_insert(sr_xavp_t *xavp, int idx, sr_xavp_t **list)
 		lst = crt;
 	}
 
+	if(lst==NULL) {
+		LM_ERR("cannot link the xavp\n");
+		return -1;
+	}
 	xavp->next = lst->next;
 	lst->next = xavp;