cmd: Avoid handle leaks (coverity).

This commit is contained in:
Frédéric Delanoy 2012-10-30 17:31:28 +01:00 committed by Alexandre Julliard
parent 64e169d974
commit 1d3f679ef1
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}