]> git.ozlabs.org Git - ccan/blobdiff - ccan/alloc/test/run.c
tdb2: copy tdb1's changed expansion logic.
[ccan] / ccan / alloc / test / run.c
index a6d021ff9e5dc87b3d1f25cf821fc15215031208..7c8fce3d76fd0f2202d4a136b1ce89712993c4cb 100644 (file)
@@ -11,7 +11,7 @@
 
 static int addr_cmp(void **a, void **b)
 {
-       return (*a) - (*b);
+       return (char *)(*a) - (char *)(*b);
 }
 
 static bool unique(void *p[], unsigned int num)
@@ -160,6 +160,8 @@ static void test(unsigned int pool_size)
        ok1(alloc_size(mem, pool_size, p[0]) < pool_size);
        alloc_free(mem, pool_size, p[0]);
        ok1(alloc_check(mem, pool_size));
+
+       free(mem);
 }
 
 int main(int argc, char *argv[])