Skip to content

Commit

Permalink
x86/boot-image: Don't leak phdrs in arch/x86/boot/compressed/misc.c::…
Browse files Browse the repository at this point in the history
…Parse_elf()

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>
  • Loading branch information
Jesper Juhl authored and Ingo Molnar committed Jan 26, 2012
1 parent 3fe5456 commit 5067cf5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5067cf5

Please sign in to comment.