X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fexamples_compile.c;h=1b2360ed52e3820e13f65e24ece05e22a3dfff67;hp=3946bdb3cb7ece4c4daa19001cbb0a5a9fb650a6;hb=03a596908b779bbb4b7c2f739c5e238f8c5d6390;hpb=90479c5a54b5c355b2f3ec6cd73f7c8c09a650a3 diff --git a/tools/ccanlint/tests/examples_compile.c b/tools/ccanlint/tests/examples_compile.c index 3946bdb3..1b2360ed 100644 --- a/tools/ccanlint/tests/examples_compile.c +++ b/tools/ccanlint/tests/examples_compile.c @@ -119,14 +119,14 @@ static char *compile(const void *ctx, char *errmsg; file->compiled = maybe_temp_file(ctx, "", keep, file->fullname); - errmsg = compile_and_link(ctx, file->fullname, ccan_dir, - obj_list(m, file), - "", lib_list(m), file->compiled); - if (errmsg) { + if (!compile_and_link(ctx, file->fullname, ccan_dir, + obj_list(m, file), + "", lib_list(m), file->compiled, &errmsg)) { talloc_free(file->compiled); file->compiled = NULL; return errmsg; } + talloc_free(errmsg); return NULL; }