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_at.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/stdlib/malloc/heap_alloc_at.c') diff --git a/libc/stdlib/malloc/heap_alloc_at.c b/libc/stdlib/malloc/heap_alloc_at.c index a65140fea..4c071b9ef 100644 --- a/libc/stdlib/malloc/heap_alloc_at.c +++ b/libc/stdlib/malloc/heap_alloc_at.c @@ -19,7 +19,7 @@ /* Allocate SIZE bytes at address MEM in HEAP. Return the actual size allocated, or 0 if we failed. */ size_t -__heap_alloc_at (struct heap *heap, void *mem, size_t size) +__heap_alloc_at (struct heap_free_area *heap, void *mem, size_t size) { struct heap_free_area *fa; size_t alloced = 0; @@ -29,7 +29,7 @@ __heap_alloc_at (struct heap *heap, void *mem, size_t size) HEAP_DEBUG (heap, "before __heap_alloc_at"); /* 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) { void *fa_mem = HEAP_FREE_AREA_START (fa); if (fa_mem <= mem) -- cgit v1.2.3