소스 검색

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);