]> git.wh0rd.org Git - elf2flt.git/commitdiff
Check `output_elf' for being NULL
authorAlexey Neyman <stilor@att.net>
Fri, 15 Feb 2019 04:12:34 +0000 (20:12 -0800)
committerMike Frysinger <vapier@gmail.com>
Sun, 17 Feb 2019 17:26:26 +0000 (12:26 -0500)
... 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 <stilor@att.net>
ld-elf2flt.c

index de39fe0558f53146daa15a1d383e902a007b31d6..ccb09b58e55f9fb2abafdaf9191ebd4320261ea9 100644 (file)
@@ -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"