From: Marek VavruĊĦa Date: Sat, 28 Nov 2015 20:34:13 +0000 (+0100) Subject: contrib/ucw: fixed bad malloc retval check X-Git-Tag: v1.0.0-beta3~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f87b7b4c4ae4762591eca647696a9f5cd8b31b3;p=thirdparty%2Fknot-resolver.git contrib/ucw: fixed bad malloc retval check --- diff --git a/contrib/ucw/mempool.c b/contrib/ucw/mempool.c index 7abac9ff8..f50c453a2 100644 --- a/contrib/ucw/mempool.c +++ b/contrib/ucw/mempool.c @@ -86,9 +86,10 @@ static void * mp_new_big_chunk(struct mempool *pool, size_t size) { struct mempool_chunk *chunk; - chunk = malloc(size + MP_CHUNK_TAIL) + size; + chunk = malloc(size + MP_CHUNK_TAIL); if (!chunk) return NULL; + chunk = (struct mempool_chunk *)((char *)chunk + size); chunk->size = size; if (pool) pool->total_size += size + MP_CHUNK_TAIL;