diff options
author | WangYuli <wangyuli@uniontech.com> | 2025-07-31 18:02:22 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 16:39:13 +0200 |
commit | fe3d2350594280e83b10726f0f8796205378d6cd (patch) | |
tree | 3ba950c4887ad9baa330d85834a9b75b2630b6e9 | |
parent | 9a3a08be429c71d03dd2e861e5acebab066311f5 (diff) |
selftests: ALSA: fix memory leak in utimer test
[ Upstream commit 6260da046819b7bda828bacae148fc8856fdebd7 ]
Free the malloc'd buffer in TEST_F(timer_f, utimer) to prevent
memory leak.
Fixes: 1026392d10af ("selftests: ALSA: Cover userspace-driven timers with test")
Reported-by: Jun Zhan <zhanjun@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Link: https://patch.msgid.link/DE4D931FCF54F3DB+20250731100222.65748-1-wangyuli@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | tools/testing/selftests/alsa/utimer-test.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/alsa/utimer-test.c b/tools/testing/selftests/alsa/utimer-test.c index 32ee3ce57721..37964f311a33 100644 --- a/tools/testing/selftests/alsa/utimer-test.c +++ b/tools/testing/selftests/alsa/utimer-test.c @@ -135,6 +135,7 @@ TEST_F(timer_f, utimer) { pthread_join(ticking_thread, NULL); ASSERT_EQ(total_ticks, TICKS_COUNT); pclose(rfp); + free(buf); } TEST(wrong_timers_test) { |