summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorAlexChen2020-08-26 12:15:53 +0200
committerLaurent Vivier2020-10-27 16:48:40 +0100
commit885538fdc9e225a502f5da69e15909664308aa93 (patch)
tree352559098d4d97d5f109edf43205cc969ea9136f /contrib
parentMerge remote-tracking branch 'remotes/kraxel/tags/modules-20201022-pull-reque... (diff)
downloadqemu-885538fdc9e225a502f5da69e15909664308aa93.tar.gz
qemu-885538fdc9e225a502f5da69e15909664308aa93.tar.xz
qemu-885538fdc9e225a502f5da69e15909664308aa93.zip
elf2dmp: Fix memory leak on main() error paths
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> Reviewed-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <5F463659.8080101@huawei.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/elf2dmp/main.c4
1 files 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])) {