Module: sip-router Branch: 4.0 Commit: cbe6d2dc199e552576501a74b3cafbceeb048385 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cbe6d2dc...
Author: Hugh Waite hugh.waite@crocodile-rcs.com Committer: Hugh Waite hugh.waite@crocodile-rcs.com Date: Wed Oct 2 10:04:35 2013 +0100
xcap_server: Fix memory allocation check bug in xcap_misc
- Would cause crash if out of package memory (cherry picked from commit 165a351d18fd0f1639087c8eb5d9294e46a6e2b7)
---
modules/xcap_server/xcap_misc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules/xcap_server/xcap_misc.c b/modules/xcap_server/xcap_misc.c index d947e7c..7ca891e 100644 --- a/modules/xcap_server/xcap_misc.c +++ b/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);