aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-08-02 17:22:00 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-02 17:22:00 -0700
commitd2b60d1311f15ebf45eff760e4815b009f6c1367 (patch)
treefe287879ac53af66fe9dd31d9c5796bf07b00820 /allocate.c
parentStart work on proper scoping with multiple files (diff)
downloadsparse-d2b60d1311f15ebf45eff760e4815b009f6c1367.tar.gz
sparse-d2b60d1311f15ebf45eff760e4815b009f6c1367.tar.bz2
sparse-d2b60d1311f15ebf45eff760e4815b009f6c1367.zip
When dropping all allocations, clear the freelist too
Otherwise we're in trouble when we try to use a "free" entry that already got its backing store removed.
Diffstat (limited to 'allocate.c')
-rw-r--r--allocate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/allocate.c b/allocate.c
index 95d6dcc..775f490 100644
--- a/allocate.c
+++ b/allocate.c
@@ -35,6 +35,7 @@ void drop_all_allocations(struct allocator_struct *desc)
desc->allocations = 0;
desc->total_bytes = 0;
desc->useful_bytes = 0;
+ desc->freelist = NULL;
while (blob) {
struct allocation_blob *next = blob->next;
blob_free(blob, desc->chunking);