Commit 42a2ad20 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use malloc() to allocate temporary process data.

parent 83f9e784
...@@ -233,7 +233,7 @@ static startup_info_t *create_startup_info( const RTL_USER_PROCESS_PARAMETERS *p ...@@ -233,7 +233,7 @@ static startup_info_t *create_startup_info( const RTL_USER_PROCESS_PARAMETERS *p
size = (size + 1) & ~1; size = (size + 1) & ~1;
*info_size = size; *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->debug_flags = params->DebugFlags;
info->console_flags = params->ConsoleFlags; info->console_flags = params->ConsoleFlags;
...@@ -461,7 +461,7 @@ static ULONG get_env_size( const RTL_USER_PROCESS_PARAMETERS *params, char **win ...@@ -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 )) if (!*winedebug && !wcsncmp( ptr, WINEDEBUG, ARRAY_SIZE( WINEDEBUG ) - 1 ))
{ {
DWORD len = wcslen(ptr) * 3 + 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 ); ntdll_wcstoumbs( ptr, wcslen(ptr) + 1, *winedebug, len, FALSE );
} }
ptr += wcslen(ptr) + 1; ptr += wcslen(ptr) + 1;
...@@ -991,8 +991,8 @@ done: ...@@ -991,8 +991,8 @@ done:
if (thread_handle) NtClose( thread_handle ); if (thread_handle) NtClose( thread_handle );
if (socketfd[0] != -1) close( socketfd[0] ); if (socketfd[0] != -1) close( socketfd[0] );
if (unixdir != -1) close( unixdir ); if (unixdir != -1) close( unixdir );
RtlFreeHeap( GetProcessHeap(), 0, startup_info ); free( startup_info );
RtlFreeHeap( GetProcessHeap(), 0, winedebug ); free( winedebug );
return status; return status;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment