qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PULL for-3.0 1/2] qga: fix 'driver' leak in guest-get-fsinfo
Date: Mon, 16 Jul 2018 16:44:49 -0500	[thread overview]
Message-ID: <20180716214450.17758-2-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180716214450.17758-1-mdroth@linux.vnet.ibm.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

'driver' is leaked when the loop is not broken.

Leak introduced by commit 743c71d03c20d64f2bae5fba6f26cdf5e4b1bda6,
spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands-posix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 233f78a406..c46767b0dd 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -890,6 +890,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
             break;
         }
 
+        g_free(driver);
         if (sscanf(p, "/%x:%x:%x.%x%n",
                           pci, pci + 1, pci + 2, pci + 3, &pcilen) == 4) {
             p += pcilen;
-- 
2.11.0

  reply	other threads:[~2018-07-16 21:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 21:44 [Qemu-devel] [PULL for-3.0 0/2] qemu-ga patch queue for hard-freeze Michael Roth
2018-07-16 21:44 ` Michael Roth [this message]
2018-07-16 21:44 ` [Qemu-devel] [PULL for-3.0 2/2] qga: fix file descriptor leak Michael Roth
2018-07-17  9:54 ` [Qemu-devel] [PULL for-3.0 0/2] qemu-ga patch queue for hard-freeze 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=20180716214450.17758-2-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).