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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@470 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2011-07-17 14:00:48 +00:00
parent fcb71434b7
commit 3ea2addc76

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;
}