mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 07:57:22 +00:00
user32: Fix a memory allocation strategy.
Otherwise, the function allocates a heap memory when prev_size is enough. What is worse is that it returns the buffer untouched if the prev_size is insufficient. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53703
This commit is contained in:
parent
548a6afccb
commit
cb0e4f5f4f
|
@ -747,7 +747,8 @@ void dispatch_win_proc_params( struct win_proc_params *params )
|
|||
/* make sure that there is space for 'size' bytes in buffer, growing it if needed */
|
||||
static inline void *get_buffer_space( void **buffer, size_t size, size_t prev_size )
|
||||
{
|
||||
if (prev_size > size && !(*buffer = HeapAlloc( GetProcessHeap(), 0, size ))) return NULL;
|
||||
if (prev_size < size)
|
||||
*buffer = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
return *buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue