Browse code

xcap_server: Fix memory allocation check bug in xcap_misc

- Would cause crash if out of package memory

Hugh Waite authored on 02/10/2013 09:04:35
Showing 1 changed files
... ...
@@ -586,7 +586,7 @@ int xcaps_xpath_set(str *inbuf, str *xpaths, str *val, str *outbuf)
586 586
 		goto error;
587 587
 	}
588 588
 	outbuf->s = (char*)pkg_malloc(size+1);
589
-	if(size<=0)
589
+	if(outbuf->s==NULL)
590 590
 	{
591 591
 		LM_ERR("no pkg for output\n");
592 592
 		xmlFree(xmem);