From 1d3f679ef1bdff2f811a57bb8e8e7be173f342fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Tue, 30 Oct 2012 17:31:28 +0100 Subject: [PATCH] cmd: Avoid handle leaks (coverity). --- programs/cmd/builtins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index e567bb64f28..b3fd422c072 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -394,6 +394,7 @@ static BOOL WCMD_AppendEOF(WCHAR *filename) SetFilePointer (h, 0, NULL, FILE_END); if (!WriteFile(h, &eof, 1, NULL, NULL)) { WINE_ERR("Failed to append EOF to %s (%d)\n", wine_dbgstr_w(filename), GetLastError()); + CloseHandle(h); return FALSE; } CloseHandle(h); @@ -430,6 +431,7 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app append?OPEN_EXISTING:CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (out == NULL) { WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(dstname), GetLastError()); + CloseHandle(in); return FALSE; }