qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>,
	Viktor Prutyanov <viktor.prutyanov@phystech.edu>,
	qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
	Li Qiang <liq3ea@gmail.com>, Laurent Vivier <laurent@vivier.eu>,
	AlexChen <alex.chen@huawei.com>
Subject: [PULL 1/8] elf2dmp: Fix memory leak on main() error paths
Date: Tue, 27 Oct 2020 17:30:07 +0100	[thread overview]
Message-ID: <20201027163014.247336-2-laurent@vivier.eu> (raw)
In-Reply-To: <20201027163014.247336-1-laurent@vivier.eu>

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>
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>
---
 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	other threads:[~2020-10-27 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 16:30 [PULL 0/8] Trivial branch for 5.2 patches Laurent Vivier
2020-10-27 16:30 ` Laurent Vivier [this message]
2020-10-27 16:30 ` [PULL 2/8] Makefile: Add *.[ch].inc files to cscope/ctags/TAGS Laurent Vivier
2020-10-27 16:30 ` [PULL 3/8] cpus: Drop declaration of cpu_remove() Laurent Vivier
2020-10-27 16:30 ` [PULL 4/8] io: Fix Lesser GPL version number Laurent Vivier
2020-10-27 16:30 ` [PULL 5/8] cryptodev: " Laurent Vivier
2020-10-27 16:30 ` [PULL 6/8] scripts/qmp: delete 'qmp' script Laurent Vivier
2020-10-27 16:30 ` [PULL 7/8] qdev: Fix two typos Laurent Vivier
2020-10-27 16:30 ` [PULL 8/8] CHANGELOG: remove disused file Laurent Vivier
2020-10-30 19:44 ` [PULL 0/8] Trivial branch for 5.2 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201027163014.247336-2-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=alex.chen@huawei.com \
    --cc=liq3ea@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=viktor.prutyanov@phystech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).