mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:13:56 +00:00
HeapReAlloc() does not allocate memory.
This commit is contained in:
parent
f5a23da2b2
commit
e81dedf1a7
1 changed files with 6 additions and 3 deletions
|
@ -1133,8 +1133,10 @@ void REGPROC_resize_char_buffer(CHAR **buffer, DWORD *len, DWORD required_len)
|
|||
if (required_len > *len)
|
||||
{
|
||||
*len = required_len;
|
||||
*buffer = HeapReAlloc(GetProcessHeap(), 0, *buffer,
|
||||
*len * sizeof(**buffer));
|
||||
if (!*buffer)
|
||||
*buffer = HeapAlloc(GetProcessHeap(), 0, *len * sizeof(**buffer));
|
||||
else
|
||||
*buffer = HeapReAlloc(GetProcessHeap(), 0, *buffer, *len * sizeof(**buffer));
|
||||
CHECK_ENOUGH_MEMORY(*buffer);
|
||||
}
|
||||
}
|
||||
|
@ -1214,7 +1216,8 @@ void export_hkey(FILE *file, HKEY key,
|
|||
if (max_val_size > *val_size)
|
||||
{
|
||||
*val_size = max_val_size;
|
||||
*val_buf = HeapReAlloc(GetProcessHeap(), 0, *val_buf, *val_size);
|
||||
if (!*val_buf) *val_buf = HeapAlloc(GetProcessHeap(), 0, *val_size);
|
||||
else *val_buf = HeapReAlloc(GetProcessHeap(), 0, *val_buf, *val_size);
|
||||
CHECK_ENOUGH_MEMORY(val_buf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue