Skip to content

Commit 6260da0

Browse files
Avenger-285714tiwai
authored andcommitted
selftests: ALSA: fix memory leak in utimer test
Free the malloc'd buffer in TEST_F(timer_f, utimer) to prevent memory leak. Fixes: 1026392 ("selftests: ALSA: Cover userspace-driven timers with test") Reported-by: Jun Zhan <[email protected]> Signed-off-by: WangYuli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent e9df175 commit 6260da0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/alsa/utimer-test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ TEST_F(timer_f, utimer) {
135135
pthread_join(ticking_thread, NULL);
136136
ASSERT_EQ(total_ticks, TICKS_COUNT);
137137
pclose(rfp);
138+
free(buf);
138139
}
139140

140141
TEST(wrong_timers_test) {

0 commit comments

Comments
 (0)