]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: ALSA: fix memory leak in utimer test
authorWangYuli <wangyuli@uniontech.com>
Thu, 31 Jul 2025 10:02:22 +0000 (18:02 +0800)
committerTakashi Iwai <tiwai@suse.de>
Thu, 31 Jul 2025 15:01:53 +0000 (17:01 +0200)
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>
tools/testing/selftests/alsa/utimer-test.c

index 32ee3ce577216b84e4cd16f1cbd630f867e5ba29..37964f311a339745f77cd4fd98cd85449dde79dc 100644 (file)
@@ -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) {