]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix (harmless) use-after-free in zone.c.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Mar 2015 17:30:16 +0000 (17:30 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Mar 2015 17:30:16 +0000 (17:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12186 d7cf8633-e32d-0410-b094-e92efae38249

zone.c

diff --git a/zone.c b/zone.c
index 2c72c113cfb50dd6c30e0a86eaef8665c279c24b..fe80693ce342fd08b9ac2171d8129f4212d76a2a 100644 (file)
--- 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));