mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
Z_Realloc() should zero-fill the expandded part of the mem
Patch from Ozkan Sezer (sezero). Thank you.
This commit is contained in:
parent
0238791b49
commit
87390f53b0
1 changed files with 2 additions and 0 deletions
|
@ -278,6 +278,8 @@ Z_Realloc (memzone_t *zone, void *ptr, int size)
|
|||
|
||||
if (ptr != old_ptr)
|
||||
memmove (ptr, old_ptr, min (old_size, size));
|
||||
if (old_size < size)
|
||||
memset ((byte *)ptr + old_size, 0, size - old_size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue