Module: wine Branch: master Commit: b12bf4d8d8b20d9234d5dd219ea33269725c1e03 URL: https://source.winehq.org/git/wine.git/?a=commit;h=b12bf4d8d8b20d9234d5dd219...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Mar 29 12:19:59 2021 +0200
ntdll: Unmap main image even if not loaded at base address.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50874 Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/unix/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 2f4d988d709..91745a2973c 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1872,7 +1872,7 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params(void) env[env_pos++] = 0;
status = load_main_exe( main_wargv[0], main_argv[0], curdir, &image, &module, &image_info ); - if (!status && image_info.Machine != current_machine) /* need to restart for Wow64 */ + if (status >= 0 && image_info.Machine != current_machine) /* need to restart for Wow64 */ { NtUnmapViewOfSection( GetCurrentProcess(), module ); status = STATUS_INVALID_IMAGE_FORMAT;