qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PULL 2/6] cpu-plug-test: fix leaks
Date: Tue, 12 Nov 2019 07:43:28 +0100	[thread overview]
Message-ID: <20191112064332.5074-3-thuth@redhat.com> (raw)
In-Reply-To: <20191112064332.5074-1-thuth@redhat.com>

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

Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20191107192731.17330-4-marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Fixes: 021a007efc3 ("cpu-plug-test: fix device_add for pc/q35 machines")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/cpu-plug-test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c
index 058cef5ac1..30e514bbfb 100644
--- a/tests/cpu-plug-test.c
+++ b/tests/cpu-plug-test.c
@@ -99,6 +99,7 @@ static void test_plug_with_device_add(gconstpointer data)
 
         cpu = qobject_to(QDict, e);
         if (qdict_haskey(cpu, "qom-path")) {
+            qobject_unref(e);
             continue;
         }
 
@@ -107,6 +108,7 @@ static void test_plug_with_device_add(gconstpointer data)
 
         qtest_qmp_device_add_qdict(qts, td->device_model, props);
         hotplugged++;
+        qobject_unref(e);
     }
 
     /* make sure that there were hotplugged CPUs */
-- 
2.23.0



  parent reply	other threads:[~2019-11-12  6:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12  6:43 [PULL 0/6] qtest and misc patches Thomas Huth
2019-11-12  6:43 ` [PULL 1/6] qtest: fix qtest_qmp_device_add leak Thomas Huth
2019-11-12  6:43 ` Thomas Huth [this message]
2019-11-12  6:43 ` [PULL 3/6] MAINTAINERS: slirp: Remove myself as maintainer Thomas Huth
2019-11-12  6:43 ` [PULL 4/6] tests/migration: Print some debug on bad status Thomas Huth
2019-11-12  6:43 ` [PULL 5/6] configure: Only decompress EDK2 blobs for X86/ARM targets Thomas Huth
2019-11-12  6:43 ` [PULL 6/6] configure: Check bzip2 is available Thomas Huth
2019-11-12 12:09 ` [PULL 0/6] qtest and misc 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=20191112064332.5074-3-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --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).