From ab18051b4f68243bf6ab428bc7a056048d2dd724 Mon Sep 17 00:00:00 2001 From: Chris Leary Date: Wed, 18 Jan 2012 18:55:01 -0800 Subject: [PATCH] Bug 719315: Free unused chunks. (r=luke) --- js/src/ds/LifoAlloc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/ds/LifoAlloc.cpp b/js/src/ds/LifoAlloc.cpp index 6ee8e49d9c7..384daae559d 100644 --- a/js/src/ds/LifoAlloc.cpp +++ b/js/src/ds/LifoAlloc.cpp @@ -143,8 +143,12 @@ LifoAlloc::freeUnused() } /* Free all chunks after |latest|. */ - for (BumpChunk *victim = latest->next(); victim; victim = victim->next()) + BumpChunk *it = latest->next(); + while (it) { + BumpChunk *victim = it; + it = it->next(); BumpChunk::delete_(victim); + } latest->setNext(NULL); }