From 7e6a669cd2f7a4526c27b53abfa0e18fc0107bcd Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 4 Mar 2015 17:30:16 +0000 Subject: [PATCH] Fix (harmless) use-after-free in zone.c. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12186 d7cf8633-e32d-0410-b094-e92efae38249 --- zone.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); -- 2.39.2