[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set
From: |
Thomas Huth |
Subject: |
[PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set |
Date: |
Fri, 3 Jun 2022 08:59:01 +0200 |
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
- [PULL 00/12] s390x and misc patches, Thomas Huth, 2022/06/03
- [PULL 04/12] MAINTAINERS: Update s390 vhost entries, Thomas Huth, 2022/06/03
- [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr, Thomas Huth, 2022/06/03
- [PULL 12/12] ui: Remove deprecated options "-sdl" and "-curses", Thomas Huth, 2022/06/03
- [PULL 02/12] hw/s390x/s390-virtio-ccw: Improve the machine description string, Thomas Huth, 2022/06/03
- [PULL 03/12] target/s390x: kvm: Honor storage keys during emulation, Thomas Huth, 2022/06/03
- [PULL 05/12] tests/tcg: Test overflow conditions, Thomas Huth, 2022/06/03
- [PULL 07/12] MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs, Thomas Huth, 2022/06/03
- [PULL 06/12] MAINTAINERS: Change my email address, Thomas Huth, 2022/06/03
- [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH, Thomas Huth, 2022/06/03
- [PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set,
Thomas Huth <=
- [PULL 10/12] ui: Remove deprecated parameters of the "-display sdl" option, Thomas Huth, 2022/06/03
- [PULL 11/12] ui: Switch "-display sdl" to use the QAPI parser, Thomas Huth, 2022/06/03
- Re: [PULL 00/12] s390x and misc patches, Richard Henderson, 2022/06/03