From 7fa16f395ab5605c7e3ba414f6ab844095aec5b4 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Wed, 13 Jun 2012 15:34:14 +0100 Subject: [PATCH] ldlinux: Don't lfree() 'kernel' twice This lead to serious problems where duplicate free blocks would appear next to each other on the free list, which created an infinite loop in the following code, for ( fp = head->next_free ; fp != head ; fp = fp->next_free ) { if ( ARENA_SIZE_GET(fp->a.attrs) >= size ) { /* Found fit -- allocate out of this block */ p = __malloc_from_block(fp, size, tag); break; } } because fp == fp->next_free, resulting in modules hanging forever at malloc() call sites. Signed-off-by: Matt Fleming --- com32/elflink/ldlinux/execute.c | 1 - 1 file changed, 1 deletion(-) diff --git a/com32/elflink/ldlinux/execute.c b/com32/elflink/ldlinux/execute.c index 97e5116..f713eb1 100644 --- a/com32/elflink/ldlinux/execute.c +++ b/com32/elflink/ldlinux/execute.c @@ -92,7 +92,6 @@ void execute(const char *cmdline, enum kernel_type type) if (type == KT_COM32) { /* new entry for elf format c32 */ - lfree((void *)kernel); create_args_and_load((char *)cmdline); } else if (type == KT_CONFIG) { char *argv[] = { "ldlinux.c32", NULL }; -- 2.7.4