summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2011-03-07 11:18:50 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2011-03-07 11:18:50 +0300
commit91a65ba2b761fa8e19083a37184301569f70ddc7 (patch)
tree8256531f96d079cf6bc156b946721f0c103ca6c0 /nasm.c
parenta59c759e095087f061fb1b45359a53724b31868d (diff)
downloadnasm-91a65ba2b761fa8e19083a37184301569f70ddc7.tar.gz
nasm-91a65ba2b761fa8e19083a37184301569f70ddc7.tar.bz2
nasm-91a65ba2b761fa8e19083a37184301569f70ddc7.zip
BR3200749: Fix "use after close" file pointer
Cleanup routine might be called several times so be ready for that. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nasm.c b/nasm.c
index 7a63afb..c0a105b 100644
--- a/nasm.c
+++ b/nasm.c
@@ -2069,7 +2069,10 @@ static char *no_pp_getline(void)
static void no_pp_cleanup(int pass)
{
(void)pass; /* placate GCC */
- fclose(no_pp_fp);
+ if (no_pp_fp) {
+ fclose(no_pp_fp);
+ no_pp_fp = NULL;
+ }
}
static uint32_t get_cpu(char *value)