summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2013-02-26 23:53:08 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2013-02-26 23:53:08 (GMT)
commit758155b3b4b44d51a9e5d6c79f9f6f66f2d5f25c (patch)
treed699f505cd43644d28cdf7627bbbd3f3c7f7a38b
parent07126ad732a9d90de6c0ddce5da4712754654eee (diff)
downloadlibwapcaplet-758155b3b4b44d51a9e5d6c79f9f6f66f2d5f25c.tar.gz
libwapcaplet-758155b3b4b44d51a9e5d6c79f9f6f66f2d5f25c.tar.bz2
Fix mempool dump reporting
-rw-r--r--src/libwapcaplet.c2
-rwxr-xr-xsrc/mempool.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libwapcaplet.c b/src/libwapcaplet.c
index 44aa919..4cbb555 100644
--- a/src/libwapcaplet.c
+++ b/src/libwapcaplet.c
@@ -72,7 +72,7 @@ static void *str_alloc(void)
}
if((p = memory_pool_alloc(mp[i]))) {
- if(p != NULL) return p;
+ return p;
}
}
return NULL; /* out of memory pools */
diff --git a/src/mempool.c b/src/mempool.c
index 4abc772..b0d0d26 100755
--- a/src/mempool.c
+++ b/src/mempool.c
@@ -97,7 +97,7 @@ void memory_pool_dump(memory_pool_t *mp, void (* print_func) (void *value))
{
block = (void *) ((uint8_t *) mp->pool + (mp->block_size * i) +
sizeof(void *) * i);
- next = (void **) ((uint8_t *) block + sizeof(void *));
+ next = (void **) ((uint8_t *) block + mp->block_size);
printf("block #%i(%p):", i, block);