x86/boot-image: Don't leak phdrs in arch/x86/boot/compressed/misc.c::Parse_elf()
authorJesper Juhl <jj@chaosbits.net>
Mon, 23 Jan 2012 22:34:59 +0000 (23:34 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Jan 2012 10:30:29 +0000 (11:30 +0100)
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@chaosbits.net>
Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1201232332590.8772@swampdragon.chaosbits.net
[ Mostly harmless. ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/boot/compressed/misc.c

index 3a19d04cebebe920e78269693c97637a19404b3b..7116dcba0c9ed2df2afd680c4407d7f57c0244a7 100644 (file)
@@ -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,