[PATCH] Don't leak in arch/x86/boot/compressed/misc.c::parse_elf()
From: Jesper Juhl
Date: Mon Jan 23 2012 - 17:35:03 EST
We allocate memory with malloc(), but neglect to free it before the
variable 'phdrs' goes out of scope --> leak.
Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>
---
arch/x86/boot/compressed/misc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
Note: Only compile tested.
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 3a19d04..7116dcb 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -321,6 +321,8 @@ static void parse_elf(void *output)
default: /* Ignore other PT_* */ break;
}
}
+
+ free(phdrs);
}
asmlinkage void decompress_kernel(void *rmode, memptr heap,
--
1.7.8.4
--
Jesper Juhl <jj@xxxxxxxxxxxxx> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/