[PATCH] switch stat and fopen

Marcus Meissner marcus at jet.franken.de
Tue Feb 13 01:51:39 CST 2007


Hi,

Coverity spotted that we leak FILE* on the stat error
path. Unlikely to happen, but just flip the two calls
to avoid this warning.

Ciao, Marcus
---
 tools/bin2res.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/bin2res.c b/tools/bin2res.c
index 3ccabb0..3b2a236 100644
--- a/tools/bin2res.c
+++ b/tools/bin2res.c
@@ -148,8 +148,8 @@ static int process_resources(const char*
     struct stat st;
     int fd, c;
 
-    if (!(fin = fopen(input_file_name, "r"))) return 0;
     if (stat(input_file_name, &st) < 0) return 0;
+    if (!(fin = fopen(input_file_name, "r"))) return 0;
     rc_last_update = st.st_mtime;
 
     if (inserting)
-- 
1.4.3.4



More information about the wine-patches mailing list