From bf0247af7a7eac9ea50687148935c7d9af32577c Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 14 Jul 2009 14:47:41 -0400 Subject: [PATCH] Don't try to fclose() the output if ofile is NULL ofile == NULL means no output file is open, so don't try to close the output file if that is true. Signed-off-by: H. Peter Anvin --- nasm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nasm.c b/nasm.c index 398472d9..ab04a111 100644 --- a/nasm.c +++ b/nasm.c @@ -473,10 +473,12 @@ int main(int argc, char **argv) } } - fclose(ofile); - if (ofile && terminate_after_phase) - remove(outname); - ofile = NULL; + if (ofile) { + fclose(ofile); + if (terminate_after_phase) + remove(outname); + ofile = NULL; + } } break; }