From: divverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Thu, 24 Jan 2008 21:43:55 +0000 (+0000)
Subject: Expandable arrays: memset to zero newly returned records (to be consistent with Mem_A... 
X-Git-Tag: xonotic-v0.1.0preview~2507
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2573a080d1428ca682e70e1999ac52d4447f8e6e;p=xonotic%2Fdarkplaces.git

Expandable arrays: memset to zero newly returned records (to be consistent with Mem_Alloc). Fixes bug with string buffers.


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8005 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/zone.c b/zone.c
index 2ab390bd..175b25a6 100644
--- a/zone.c
+++ b/zone.c
@@ -431,6 +431,7 @@ void *Mem_ExpandableArray_AllocRecord(memexpandablearray_t *l)
 				{
 					l->arrays[i].allocflags[j] = true;
 					l->arrays[i].numflaggedrecords++;
+					memset(l->arrays[i].data + l->recordsize * j, 0, l->recordsize);
 					return (void *)(l->arrays[i].data + l->recordsize * j);
 				}
 			}