From 86b55b47e3980d90d9d8cd3ea36b35ef2b10b96c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 5 Jun 2008 10:25:02 +0200 Subject: [PATCH] Fix a memleak in ads_find_dc() in case get_sorted_dc_list() fails This is really not a proper place to fix this, but as get_gc_list() and friends are about to be replaced anyway, just work around the broken existing API (cherry picked from commit 6bcfa82ff15531c64e0db27dcc58e5847c513aa6) --- source/libads/ldap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libads/ldap.c b/source/libads/ldap.c index 063645febf7..7f26d3da104 100644 --- a/source/libads/ldap.c +++ b/source/libads/ldap.c @@ -319,6 +319,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) status = get_sorted_dc_list(realm, sitename, &ip_list, &count, got_realm); if (!NT_STATUS_IS_OK(status)) { + SAFE_FREE(ip_list); /* fall back to netbios if we can */ if ( got_realm && !lp_disable_netbios() ) { got_realm = False; -- 2.11.4.GIT