diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-05-31 12:09:21 +0400 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2022-06-03 08:03:28 +0200 |
commit | d412597ec5a8406b2af6aa5fb7740e77c1bd3f8c (patch) | |
tree | 0a81116fb1eb41f73762fbdb4ebab66a52c5e4c1 /tests/qtest/npcm7xx_pwm-test.c | |
parent | c5f1bb4272a6c2d10dd92fd2285ed5adb988088e (diff) | |
download | qemu-d412597ec5a8406b2af6aa5fb7740e77c1bd3f8c.zip qemu-d412597ec5a8406b2af6aa5fb7740e77c1bd3f8c.tar.gz qemu-d412597ec5a8406b2af6aa5fb7740e77c1bd3f8c.tar.bz2 |
qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set
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>
Diffstat (limited to 'tests/qtest/npcm7xx_pwm-test.c')
-rw-r--r-- | tests/qtest/npcm7xx_pwm-test.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/qtest/npcm7xx_pwm-test.c b/tests/qtest/npcm7xx_pwm-test.c index c4a5fdc..e320a62 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) |