From 64294d21873d888083be39cb5010eb0dd73c8896 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 15 Oct 2024 17:46:24 +0200 Subject: [PATCH] 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 Reviewed-by: Martin Schwenke --- nsswitch/libwbclient/wbc_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nsswitch/libwbclient/wbc_util.c b/nsswitch/libwbclient/wbc_util.c index 9e54baf54d7..5618039a89d 100644 --- a/nsswitch/libwbclient/wbc_util.c +++ b/nsswitch/libwbclient/wbc_util.c @@ -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; } } -- 2.47.3