Module: wine Branch: master Commit: 42a2ad202e6a260dc9e3f04939c7dacf270f7434 URL: https://source.winehq.org/git/wine.git/?a=commit;h=42a2ad202e6a260dc9e3f0493...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Jul 14 10:33:57 2020 +0200
ntdll: Use malloc() to allocate temporary process data.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/unix/process.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index 8b03834df6..83c67737f8 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -233,7 +233,7 @@ static startup_info_t *create_startup_info( const RTL_USER_PROCESS_PARAMETERS *p size = (size + 1) & ~1; *info_size = size;
- if (!(info = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, size ))) return NULL; + if (!(info = calloc( size, 1 ))) return NULL;
info->debug_flags = params->DebugFlags; info->console_flags = params->ConsoleFlags; @@ -461,7 +461,7 @@ static ULONG get_env_size( const RTL_USER_PROCESS_PARAMETERS *params, char **win if (!*winedebug && !wcsncmp( ptr, WINEDEBUG, ARRAY_SIZE( WINEDEBUG ) - 1 )) { DWORD len = wcslen(ptr) * 3 + 1; - if ((*winedebug = RtlAllocateHeap( GetProcessHeap(), 0, len ))) + if ((*winedebug = malloc( len ))) ntdll_wcstoumbs( ptr, wcslen(ptr) + 1, *winedebug, len, FALSE ); } ptr += wcslen(ptr) + 1; @@ -991,8 +991,8 @@ done: if (thread_handle) NtClose( thread_handle ); if (socketfd[0] != -1) close( socketfd[0] ); if (unixdir != -1) close( unixdir ); - RtlFreeHeap( GetProcessHeap(), 0, startup_info ); - RtlFreeHeap( GetProcessHeap(), 0, winedebug ); + free( startup_info ); + free( winedebug ); return status; }