mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
Make sure RestoreLastError is only called with a valid error code
This commit is contained in:
parent
e962b67f40
commit
866d4d8001
1 changed files with 3 additions and 2 deletions
|
@ -606,7 +606,7 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
|
|||
STARTUPINFOW startup;
|
||||
PROCESS_INFORMATION info;
|
||||
UINT_PTR retval = SE_ERR_NOASSOC;
|
||||
UINT gcdret = 0, gle;
|
||||
UINT gcdret = 0, gle = 0;
|
||||
WCHAR curdir[MAX_PATH];
|
||||
DWORD dwCreationFlags;
|
||||
const WCHAR *lpDirectory = NULL;
|
||||
|
@ -688,7 +688,8 @@ done:
|
|||
{
|
||||
if (!SetCurrentDirectoryW(curdir))
|
||||
ERR("cannot return to directory %s\n", debugstr_w(curdir));
|
||||
RestoreLastError(gle);
|
||||
if (gle)
|
||||
RestoreLastError(gle);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue