From 9672f9918b49cf8d9e6ff99f8fbd100572624940 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 15 Oct 2024 17:12:07 +0200 Subject: [PATCH] nsswitch: Fix memory leak in nsstest Direct leak of 832 byte(s) in 13 object(s) allocated from: #0 0x7efc8e0fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x562cb6e96d44 in nss_test_initgroups ../../nsswitch/nsstest.c:381 #2 0x562cb6e96d44 in nss_test_users ../../nsswitch/nsstest.c:424 #3 0x562cb6e96d44 in main ../../nsswitch/nsstest.c:493 #4 0x7efc8dc2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke --- nsswitch/nsstest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nsswitch/nsstest.c b/nsswitch/nsstest.c index 45270cdc459..21d04b53126 100644 --- a/nsswitch/nsstest.c +++ b/nsswitch/nsstest.c @@ -395,6 +395,7 @@ static void nss_test_initgroups(char *name, gid_t gid) printf("%lu, ", (unsigned long)groups[i]); } printf("%lu\n", (unsigned long)groups[i]); + SAFE_FREE(groups); }