X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=zone.c;h=72432d551a9ef485df3eae579130225548f657ce;hb=24239eb76e491838a062d5397c194e29b783e04c;hp=7c601cf0918986fd3aec2590ea740b5ee9813d79;hpb=4aa041287d27a50f7cbfd4628d80c118e1bfcade;p=xonotic%2Fdarkplaces.git diff --git a/zone.c b/zone.c index 7c601cf0..72432d55 100644 --- a/zone.c +++ b/zone.c @@ -634,7 +634,7 @@ void Mem_ExpandableArray_FreeArray(memexpandablearray_t *l) void *Mem_ExpandableArray_AllocRecordAtIndex(memexpandablearray_t *l, size_t index) { size_t j; - if (index == l->numarrays) + if (index >= l->numarrays) { if (l->numarrays == l->maxarrays) { @@ -844,8 +844,10 @@ void MemStats_f(void) char* Mem_strdup (mempool_t *pool, const char* s) { char* p; - size_t sz = strlen (s) + 1; - if (s == NULL) return NULL; + size_t sz; + if (s == NULL) + return NULL; + sz = strlen (s) + 1; p = (char*)Mem_Alloc (pool, sz); strlcpy (p, s, sz); return p;