From 6494060312de389feb65ad32bb411fcc64e821b7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 11 Oct 2008 08:52:58 +0000 Subject: Fix bug 4994 hangs on read(). I have tested the patch extensibly on ARM/LT.old. Thank you Chase Douglas for reporting it and for the patch. --- libc/stdlib/malloc/heap_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/stdlib/malloc/heap_alloc.c') diff --git a/libc/stdlib/malloc/heap_alloc.c b/libc/stdlib/malloc/heap_alloc.c index 9f5fd6c1a..cd52038d3 100644 --- a/libc/stdlib/malloc/heap_alloc.c +++ b/libc/stdlib/malloc/heap_alloc.c @@ -20,7 +20,7 @@ *SIZE is adjusted to reflect the actual amount allocated (which may be greater than requested). */ void * -__heap_alloc (struct heap *heap, size_t *size) +__heap_alloc (struct heap_free_area *heap, size_t *size) { struct heap_free_area *fa; size_t _size = *size; @@ -36,7 +36,7 @@ __heap_alloc (struct heap *heap, size_t *size) HEAP_DEBUG (heap, "before __heap_alloc"); /* Look for a free area that can contain _SIZE bytes. */ - for (fa = heap->free_areas; fa; fa = fa->next) + for (fa = heap; fa; fa = fa->next) if (fa->size >= _size) { /* Found one! */ -- cgit v1.2.3