1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Andreas Schneider 2024-10-15 17:12:07 +02:00 committed by Martin Schwenke
parent 6a1196c567
commit 9672f9918b

View File

@ -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);
}