Fix a memleak in ads_find_dc() in case get_sorted_dc_list() fails
authorVolker Lendecke <vl@samba.org>
Thu, 5 Jun 2008 08:25:02 +0000 (10:25 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 5 Jun 2008 08:56:18 +0000 (10:56 +0200)
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
(This used to be commit df8d089bc63c2a52cbdf3504cded8df620a59902)

source3/libads/ldap.c

index 37c0c4d0ac49993fdd17f033d5be401a0f84e350..fc336d988b2a796bb7c432844ed5a314ef077bfa 100644 (file)
@@ -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;