浏览代码

core: safety check for linker when inserting xavp with index

Daniel-Constantin Mierla 10 年之前
父节点
当前提交
ec438b4569
共有 1 个文件被更改,包括 4 次插入0 次删除
  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;