Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: ALSA: fix memory leak in utimer test

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>

authored by

WangYuli and committed by
Takashi Iwai
6260da04 e9df1755

+1
+1
tools/testing/selftests/alsa/utimer-test.c
··· 135 135 pthread_join(ticking_thread, NULL); 136 136 ASSERT_EQ(total_ticks, TICKS_COUNT); 137 137 pclose(rfp); 138 + free(buf); 138 139 } 139 140 140 141 TEST(wrong_timers_test) {