arena: fix btag freeing in arena_destroy() We are freeing the btags, not the objects they point to. Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/kern/src/arena.c b/kern/src/arena.c index 00807ee..2c26ff3 100644 --- a/kern/src/arena.c +++ b/kern/src/arena.c
@@ -239,12 +239,12 @@ * The BTs that are page aligned are the ones we want. We can just * ignore the others (unlink from the list). */ BSD_LIST_FOREACH_SAFE(bt_i, &arena->unused_btags, misc_link, temp) { - if (PGOFF(bt_i->start)) + if (PGOFF(bt_i)) BSD_LIST_REMOVE(bt_i, misc_link); } /* Now the remaining BTs are the first on their page. */ BSD_LIST_FOREACH_SAFE(bt_i, &arena->unused_btags, misc_link, temp) - arena_free(find_my_base(arena), (void*)bt_i->start, PGSIZE); + arena_free(find_my_base(arena), bt_i, PGSIZE); kfree(arena); }