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>
master
Miaoqian Lin 2022-05-31 12:09:21 +04:00 committed by Thomas Huth
parent c5f1bb4272
commit d412597ec5
1 changed files with 3 additions and 0 deletions

View File

@ -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)