When we actually delete the area, we can obviously not access the next pointer
stored in there anymore. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32951 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1618,6 +1618,7 @@ heap_free(heap_allocator *heap, void *address)
|
|||||||
|
|
||||||
area = heap->areas;
|
area = heap->areas;
|
||||||
while (area != NULL && heap->empty_areas > 1) {
|
while (area != NULL && heap->empty_areas > 1) {
|
||||||
|
heap_area *next = area->next;
|
||||||
if (area->area >= 0
|
if (area->area >= 0
|
||||||
&& area->free_page_count == area->page_count
|
&& area->free_page_count == area->page_count
|
||||||
&& heap_remove_area(heap, area) == B_OK) {
|
&& heap_remove_area(heap, area) == B_OK) {
|
||||||
@@ -1625,7 +1626,7 @@ heap_free(heap_allocator *heap, void *address)
|
|||||||
heap->empty_areas--;
|
heap->empty_areas--;
|
||||||
}
|
}
|
||||||
|
|
||||||
area = area->next;
|
area = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user