Browse Source

avoid crash when OOM on mem_realloc

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@150 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.1
Xuefer 15 years ago
parent
commit
7d5390168d
  1. 2
      mem.c

2
mem.c

@ -254,7 +254,7 @@ static XC_MEM_CALLOC(xc_mem_calloc) /* {{{ */
static XC_MEM_REALLOC(xc_mem_realloc) /* {{{ */
{
void *newp = xc_mem_malloc(mem, size);
if (p) {
if (p && newp) {
memcpy(newp, p, size);
xc_mem_free(mem, p);
}

Loading…
Cancel
Save