summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2005-02-11 20:21:37 +0000
committerwtchang%redhat.com <devnull@localhost>2005-02-11 20:21:37 +0000
commitc8dd5671a5e342d65ab69c6b54788f0ccf6d1acf (patch)
treeefe6e202a66ac52776f9efbb88b3b6a5fb76ca7a
parentc413f470cbaec95c18233552b0784f2430436614 (diff)
downloadnspr-hg-c8dd5671a5e342d65ab69c6b54788f0ccf6d1acf.tar.gz
Bugzilla Bug 281763: fixed a leak of the first arena on the freelist whenMOZILLA_1_8b1_RELEASE
the second arena is taken. The patch is contributed by Nelson Bolyard of Sun Microsystems. r=wtc. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--lib/ds/plarena.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ds/plarena.c b/lib/ds/plarena.c
index 34d675fc..638f5bdb 100644
--- a/lib/ds/plarena.c
+++ b/lib/ds/plarena.c
@@ -184,9 +184,9 @@ PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
if ( PR_FAILURE == LockArena())
return(0);
- for ( a = p = arena_freelist; a != NULL ; p = a, a = a->next ) {
+ for ( a = arena_freelist, p = NULL; a != NULL ; p = a, a = a->next ) {
if ( a->base +nb <= a->limit ) {
- if ( p == arena_freelist )
+ if ( p == NULL )
arena_freelist = a->next;
else
p->next = a->next;