gamevars.c: don't leak memory in Gv_NewArray(). DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4793 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-12-05 20:02:19 +00:00
parent e00b2c627a
commit 09e12917f0

View file

@ -424,6 +424,7 @@ int32_t Gv_NewArray(const char *pszLabel, void *arrayptr, intptr_t asize, uint32
if (!(dwFlags & GAMEARRAY_TYPE_MASK)) if (!(dwFlags & GAMEARRAY_TYPE_MASK))
{ {
Baligned_free(aGameArrays[i].plValues);
aGameArrays[i].plValues = (intptr_t *)Xaligned_alloc(ACTOR_VAR_ALIGNMENT, asize * GAR_ELTSZ); aGameArrays[i].plValues = (intptr_t *)Xaligned_alloc(ACTOR_VAR_ALIGNMENT, asize * GAR_ELTSZ);
Bmemset(aGameArrays[i].plValues, 0, asize * GAR_ELTSZ); Bmemset(aGameArrays[i].plValues, 0, asize * GAR_ELTSZ);
} }