1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

nsswitch: Fix memory leak in wbcDomainInfoList

==379167==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 44 byte(s) in 2 object(s) allocated from:
    #0 0x7f54522f6880 in strdup ../../../../libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x7f54520d5a95 in process_domain_info_string ../../nsswitch/libwbclient/wbc_util.c:471
    #2 0x7f54520d5a95 in wbcCtxListTrusts ../../nsswitch/libwbclient/wbc_util.c:612
    #3 0x7f54520d6426 in wbcListTrusts ../../nsswitch/libwbclient/wbc_util.c:632
    #4 0x558c48799cf7 in wbinfo_list_domains ../../nsswitch/wbinfo.c:515
    #5 0x558c487a72db in main ../../nsswitch/wbinfo.c:3300
    #6 0x7f544f42a2ad 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:46:24 +02:00 committed by Martin Schwenke
parent 9672f9918b
commit 64294d2187

View File

@ -549,6 +549,7 @@ static void wbcDomainInfoListDestructor(void *ptr)
while (i->short_name != NULL) {
free(i->short_name);
free(i->dns_name);
free(i->trust_routing);
i += 1;
}
}