qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-s390x@nongnu.org, Miaoqian Lin <linmq006@gmail.com>,
	Hao Wu <wuhaotsh@google.com>
Subject: [PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set
Date: Fri,  3 Jun 2022 08:59:01 +0200	[thread overview]
Message-ID: <20220603065905.23805-9-thuth@redhat.com> (raw)
In-Reply-To: <20220603065905.23805-1-thuth@redhat.com>

From: Miaoqian Lin <linmq006@gmail.com>

g_strdup_printf() allocated memory for path, we should free it with
g_free() when no longer needed.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Message-Id: <20220531080921.4704-1-linmq006@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/npcm7xx_pwm-test.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qtest/npcm7xx_pwm-test.c b/tests/qtest/npcm7xx_pwm-test.c
index c4a5fdcacd..e320a625c4 100644
--- a/tests/qtest/npcm7xx_pwm-test.c
+++ b/tests/qtest/npcm7xx_pwm-test.c
@@ -268,6 +268,9 @@ static void mft_qom_set(QTestState *qts, int index, const char *name,
             path, name, value);
     /* The qom set message returns successfully. */
     g_assert_true(qdict_haskey(response, "return"));
+
+    qobject_unref(response);
+    g_free(path);
 }
 
 static uint32_t get_pll(uint32_t con)
-- 
2.31.1



  parent reply	other threads:[~2022-06-03  7:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
2022-06-03  6:58 ` [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH Thomas Huth
2022-06-03  6:58 ` [PULL 02/12] hw/s390x/s390-virtio-ccw: Improve the machine description string Thomas Huth
2022-06-03  6:58 ` [PULL 03/12] target/s390x: kvm: Honor storage keys during emulation Thomas Huth
2022-06-03  6:58 ` [PULL 04/12] MAINTAINERS: Update s390 vhost entries Thomas Huth
2022-06-03  6:58 ` [PULL 05/12] tests/tcg: Test overflow conditions Thomas Huth
2022-06-03  6:58 ` [PULL 06/12] MAINTAINERS: Change my email address Thomas Huth
2022-06-03  6:59 ` [PULL 07/12] MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs Thomas Huth
2022-06-03  6:59 ` Thomas Huth [this message]
2022-06-03  6:59 ` [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr Thomas Huth
2022-06-03  6:59 ` [PULL 10/12] ui: Remove deprecated parameters of the "-display sdl" option Thomas Huth
2022-06-03  6:59 ` [PULL 11/12] ui: Switch "-display sdl" to use the QAPI parser Thomas Huth
2022-06-03  6:59 ` [PULL 12/12] ui: Remove deprecated options "-sdl" and "-curses" Thomas Huth
2022-06-03 15:16 ` [PULL 00/12] s390x and misc patches Richard Henderson

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=20220603065905.23805-9-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=linmq006@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=wuhaotsh@google.com \
    /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).