Skip to content

Commit

Permalink
qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yuuoniy authored and huth committed Jun 3, 2022
1 parent c5f1bb4 commit d412597
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/qtest/npcm7xx_pwm-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d412597

Please sign in to comment.