X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftal%2Ftest%2Frun-test-backend.c;h=ebcd811192cfc9e2c39f09e9aff914ce25767ed0;hp=4663a5664a0bfedcb93cde5b8094791f2bf863f7;hb=HEAD;hpb=e03d7ecb505cb73ff244708323b0f1a5a0c5cd7a diff --git a/ccan/tal/test/run-test-backend.c b/ccan/tal/test/run-test-backend.c index 4663a566..ebcd8111 100644 --- a/ccan/tal/test/run-test-backend.c +++ b/ccan/tal/test/run-test-backend.c @@ -31,7 +31,7 @@ static void *my_realloc(void *old, size_t new_size) #define NUM_ALLOCS 1000 -static void destroy_p(void *p) +static void destroy_p(void *p UNNEEDED) { } @@ -53,7 +53,8 @@ int main(void) tal_add_destructor(p, destroy_p); tal_set_name(p, "test"); - name = tal_asprintf(NULL, "test2"); + name = tal_arr(NULL, char, 6); + strcpy(name, "test2"); tal_set_name(p, name); /* makes us free old name */ tal_set_name(p, name); @@ -74,5 +75,6 @@ int main(void) /* Finally, free the parent. */ tal_free(p); + tal_cleanup(); return exit_status(); }