aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-02-17 20:24:11 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-02-17 15:24:11 -0500
commitb9a73e32f1b50244147d757e64e1dd47ad09202a (patch)
treed5ce7672aaabf652f426f1e58d830af07d5ca7e1 /gcc/bitmap.c
parent9185a8d526d92f84d14f4e25734441ea6a69a0f6 (diff)
downloadgcc-b9a73e32f1b50244147d757e64e1dd47ad09202a.zip
gcc-b9a73e32f1b50244147d757e64e1dd47ad09202a.tar.gz
gcc-b9a73e32f1b50244147d757e64e1dd47ad09202a.tar.bz2
* bitmap.c (bitmap_operation): Don't leak bitmap elements.
From-SVN: r32038
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index f43965c..6c6c978 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -477,7 +477,7 @@ bitmap_operation (to, from1, from2, operation)
changed = 1;
to_tmp = to_ptr;
to_ptr = to_ptr->next;
- to_tmp = bitmap_free;
+ to_tmp->next = bitmap_free;
bitmap_free = to_tmp;
}
if (to_ptr && to_ptr->indx == indx)
@@ -517,6 +517,11 @@ bitmap_operation (to, from1, from2, operation)
to_tmp->indx = indx;
bitmap_element_link (to, to_tmp);
}
+ else
+ {
+ to_tmp->next = bitmap_free;
+ bitmap_free = to_tmp;
+ }
}
/* If we have elements of TO left over, free the lot. */