Commit 9f87b7b4 authored by Marek Vavruša's avatar Marek Vavruša

contrib/ucw: fixed bad malloc retval check

parent 534acf1b
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment