[PATCH] xcopy: fclose filedescriptor on eof case (Coverity)

Marcus Meissner meissner at suse.de
Mon Jul 15 14:33:32 CDT 2013


713860 Resource leak
---
 programs/xcopy/xcopy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/programs/xcopy/xcopy.c b/programs/xcopy/xcopy.c
index 7a68831..f894b0e 100644
--- a/programs/xcopy/xcopy.c
+++ b/programs/xcopy/xcopy.c
@@ -291,6 +291,7 @@ static BOOL XCOPY_ProcessExcludeFile(WCHAR* filename, WCHAR* endOfName) {
     if (!feof(inFile)) {
         XCOPY_wprintf(XCOPY_LoadMessage(STRING_READFAIL), filename);
         *endOfName = endChar;
+        fclose(inFile);
         return TRUE;
     }
 
-- 
1.8.3




More information about the wine-patches mailing list