From: AlexChen <alex.c...@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.c...@huawei.com>
Reviewed-by: Li Qiang <liq...@gmail.com>
Reviewed-by: Viktor Prutyanov <viktor.prutya...@phystech.edu>
Reviewed-by: Thomas Huth <th...@redhat.com>
Message-Id: <5f463659.8080...@huawei.com>
Signed-off-by: Laurent Vivier <laur...@vivier.eu>
---
 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 9a2dbc290214..ac746e49e097 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])) {
-- 
2.26.2


Reply via email to