[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elf2dmp: Fix memory leak on main() error paths
From: |
AlexChen |
Subject: |
Re: elf2dmp: Fix memory leak on main() error paths |
Date: |
Fri, 4 Sep 2020 09:04:39 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
Kindly ping.
On 2020/8/26 18:15, AlexChen wrote:
> From: AlexChen <alex.chen@huawei.com>
>
> The 'kdgb' is allocating memory in get_kdbg(), but it is not freed
> in both fill_header() and fill_context() failed branches, fix it.
>
> Signed-off-by: AlexChen <alex.chen@huawei.com>
> ---
> contrib/elf2dmp/main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c
> index 9a2dbc2902..ac746e49e0 100644
> --- a/contrib/elf2dmp/main.c
> +++ b/contrib/elf2dmp/main.c
> @@ -568,12 +568,12 @@ int main(int argc, char *argv[])
> if (fill_header(&header, &ps, &vs, KdDebuggerDataBlock, kdbg,
> KdVersionBlock, qemu_elf.state_nr)) {
> err = 1;
> - goto out_pdb;
> + goto out_kdbg;
> }
>
> if (fill_context(kdbg, &vs, &qemu_elf)) {
> err = 1;
> - goto out_pdb;
> + goto out_kdbg;
> }
>
> if (write_dump(&ps, &header, argv[2])) {
>
- Re: elf2dmp: Fix memory leak on main() error paths,
AlexChen <=