Browse Source

xcap_server: Fix memory allocation check bug in xcap_misc

- Would cause crash if out of package memory
Hugh Waite 12 years ago
parent
commit
49720ce99e
1 changed files with 1 additions and 1 deletions
  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);