zone.c (Z_Realloc): If expanding size, zero-fill the expanded part

of the memory before returning, which is Z_Malloc() behavior.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@470 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2011-07-17 14:00:48 +00:00
parent cc2484d042
commit df4a1685a0
1 changed files with 2 additions and 0 deletions

View File

@ -238,6 +238,8 @@ void *Z_Realloc(void *ptr, int size)
if (ptr != old_ptr)
memmove (ptr, old_ptr, q_min(old_size, size));
if (old_size < size)
memset ((byte *)ptr + old_size, 0, size - old_size);
return ptr;
}