From: Alexey Neyman Date: Fri, 15 Feb 2019 04:12:34 +0000 (-0800) Subject: Check `output_elf' for being NULL X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4996ccdadecaf0169dc3fcc2ac996893f0f7eae1;p=elf2flt.git Check `output_elf' for being NULL ... before passing it to unlink(). GCC8.2 detects that one of the branches in do_final_link() does not initialize it from its original value, NULL. Signed-off-by: Alexey Neyman --- diff --git a/ld-elf2flt.c b/ld-elf2flt.c index de39fe0..ccb09b5 100644 --- a/ld-elf2flt.c +++ b/ld-elf2flt.c @@ -568,7 +568,9 @@ int main(int argc, char *argv[]) if (!flag_verbose) { unlink(tmp_file); unlink(output_flt); - unlink(output_elf); + if (output_elf) { + unlink(output_elf); + } } else { fprintf(stderr, "leaving elf2flt temp files behind:\n"