From: divverent Date: Wed, 4 Mar 2015 17:30:16 +0000 (+0000) Subject: Fix (harmless) use-after-free in zone.c. X-Git-Tag: xonotic-v0.8.1~8^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7e6a669cd2f7a4526c27b53abfa0e18fc0107bcd;p=xonotic%2Fdarkplaces.git Fix (harmless) use-after-free in zone.c. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12186 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/zone.c b/zone.c index 2c72c113..fe80693c 100644 --- a/zone.c +++ b/zone.c @@ -558,9 +558,11 @@ void _Mem_FreePool(mempool_t **poolpointer, const char *filename, int fileline) _Mem_FreeBlock(pool->chain, filename, fileline); // free child pools, too - for(iter = poolchain; iter; temp = iter = iter->next) + for(iter = poolchain; iter; iter = temp) { + temp = iter->next; if(iter->parent == pool) _Mem_FreePool(&temp, filename, fileline); + } // free the pool itself Clump_FreeBlock(pool, sizeof(*pool));