summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-08-25 11:10:46 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-08-25 11:22:57 -0700
commit464ba911c3b84abb0140e9f66756d1cc887f78ad (patch)
treecb4e4248a050efefc1a457bfbfce43f8a8710874
parent061960e38cb0d6873bda2550f6a8952668193888 (diff)
Avoid closing inFile twice in CheckImakefileC if LogFatal returns
Imake's LogFatal() checks if it's being re-entered and if so, returns, so we can't mark it NORETURN, leading to static analyzers believing it can return even in call paths it shouldn't. Resolves warning from Parfait 1.0.1: Error: File Invalid File not Initialized: The value inFile is not initialized as a file. at line 748 of imake.c in function 'CheckImakefileC'. inFile initialized at line 738 with fopen(masterc, "r"). inFile destroyed at line 745 with fclose(inFile). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--imake.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/imake.c b/imake.c
index 1cb8388..2ca34c3 100644
--- a/imake.c
+++ b/imake.c
@@ -745,7 +745,8 @@ CheckImakefileC(const char *masterc)
fclose(inFile);
LogFatal("Refuse to overwrite: %s", masterc);
}
- fclose(inFile);
+ else
+ fclose(inFile);
}
}