浏览代码

xcap_server: Fix memory allocation check bug in xcap_misc

- Would cause crash if out of package memory
Hugh Waite 12 年之前
父节点
当前提交
49720ce99e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/xcap_server/xcap_misc.c

+ 1 - 1
modules/xcap_server/xcap_misc.c

@@ -586,7 +586,7 @@ int xcaps_xpath_set(str *inbuf, str *xpaths, str *val, str *outbuf)
 		goto error;
 	}
 	outbuf->s = (char*)pkg_malloc(size+1);
-	if(size<=0)
+	if(outbuf->s==NULL)
 	{
 		LM_ERR("no pkg for output\n");
 		xmlFree(xmem);