summaryrefslogtreecommitdiffstats
path: root/contrib/ucw
diff options
context:
space:
mode:
authorMarek Vavruša <marek.vavrusa@nic.cz>2015-11-28 21:34:13 +0100
committerMarek Vavruša <marek.vavrusa@nic.cz>2015-11-28 21:34:13 +0100
commit9f87b7b4c4ae4762591eca647696a9f5cd8b31b3 (patch)
tree8a0ca78df6c7c621fd2b6c30c6a88bb48691dcd6 /contrib/ucw
parentlib/dnssec: fixed missing checks in label skipping (diff)
downloadknot-resolver-9f87b7b4c4ae4762591eca647696a9f5cd8b31b3.tar.xz
knot-resolver-9f87b7b4c4ae4762591eca647696a9f5cd8b31b3.zip
contrib/ucw: fixed bad malloc retval check
Diffstat (limited to 'contrib/ucw')
-rw-r--r--contrib/ucw/mempool.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/ucw/mempool.c b/contrib/ucw/mempool.c
index 7abac9ff..f50c453a 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;