]> git.ozlabs.org Git - ccan/blobdiff - ccan/jmap/test/run-ptridx-type.c
jmap: fix jmap_free, tests.
[ccan] / ccan / jmap / test / run-ptridx-type.c
index aa715cf51162b70f80ed3a18d14795a69b4ed9ae..20a604a1fcde6f797a30fe1575918a92ba74c17e 100644 (file)
@@ -17,7 +17,7 @@ static int cmp_ptr(const void *a, const void *b)
 int main(int argc, char *argv[])
 {
        struct jmap_foo *map;
-       struct foo *foo[NUM], **foop;
+       struct foo *foo[NUM+1], **foop;
        struct idx *idx[NUM+1], *index;
 
        unsigned int i;
@@ -97,5 +97,8 @@ int main(int argc, char *argv[])
        ok1(jmap_foo_error(map) == NULL);
        jmap_foo_free(map);
 
+       for (i = 0; i < NUM+1; i++)
+               free(foo[i]);
+
        return exit_status();
 }