cmd: Avoid handle leaks (coverity).
This commit is contained in:
parent
64e169d974
commit
1d3f679ef1
@ -394,6 +394,7 @@ static BOOL WCMD_AppendEOF(WCHAR *filename)
|
|||||||
SetFilePointer (h, 0, NULL, FILE_END);
|
SetFilePointer (h, 0, NULL, FILE_END);
|
||||||
if (!WriteFile(h, &eof, 1, NULL, NULL)) {
|
if (!WriteFile(h, &eof, 1, NULL, NULL)) {
|
||||||
WINE_ERR("Failed to append EOF to %s (%d)\n", wine_dbgstr_w(filename), GetLastError());
|
WINE_ERR("Failed to append EOF to %s (%d)\n", wine_dbgstr_w(filename), GetLastError());
|
||||||
|
CloseHandle(h);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
CloseHandle(h);
|
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);
|
append?OPEN_EXISTING:CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(dstname), GetLastError());
|
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(dstname), GetLastError());
|
||||||
|
CloseHandle(in);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user