]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nsswitch: Fix memory leak in wbcDomainInfoList
authorAndreas Schneider <asn@samba.org>
Tue, 15 Oct 2024 15:46:24 +0000 (17:46 +0200)
committerMartin Schwenke <martins@samba.org>
Thu, 24 Oct 2024 10:54:37 +0000 (10:54 +0000)
==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>
nsswitch/libwbclient/wbc_util.c

index 9e54baf54d74771e6ac7e1ed92f5c3c599076ce6..5618039a89d68ca1eb5d0836db09d646f4153fd8 100644 (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;
        }
 }