X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fexamples_compile.c;h=1b2360ed52e3820e13f65e24ece05e22a3dfff67;hb=03a596908b779bbb4b7c2f739c5e238f8c5d6390;hp=3946bdb3cb7ece4c4daa19001cbb0a5a9fb650a6;hpb=f1c96e9df6efed3c7a8d43495f1aa0bef6b5cefd;p=ccan-lca-2011.git diff --git a/tools/ccanlint/tests/examples_compile.c b/tools/ccanlint/tests/examples_compile.c index 3946bdb..1b2360e 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; }