]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libads: In ads_connect(), and ads_disconnect(), replace ZERO_STRUCT(ads->ldap...
authorJeremy Allison <jra@samba.org>
Sat, 8 Aug 2020 03:24:07 +0000 (20:24 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 18 Aug 2020 08:25:39 +0000 (08:25 +0000)
This clears out the memory, but also leaves ads->ldap as a valid (zero) IPaddr.
Otherwise it's left by accident as AF_UNSPEC (0).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libads/ldap.c

index 18e2b86fb8e06607ffe2dec8b2c8f831f26f5ee1..33bf3aebf297d86b4123c199f77bc59977090ef8 100755 (executable)
@@ -595,7 +595,7 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
        NTSTATUS ntstatus;
        char addr[INET6_ADDRSTRLEN];
 
-       ZERO_STRUCT(ads->ldap);
+       ads_zero_ldap(ads);
        ZERO_STRUCT(ads->ldap_wrap_data);
        ads->ldap.last_attempt  = time_mono(NULL);
        ads->ldap_wrap_data.wrap_type   = ADS_SASLWRAP_TYPE_PLAIN;
@@ -785,7 +785,7 @@ void ads_disconnect(ADS_STRUCT *ads)
        if (ads->ldap_wrap_data.mem_ctx) {
                talloc_free(ads->ldap_wrap_data.mem_ctx);
        }
-       ZERO_STRUCT(ads->ldap);
+       ads_zero_ldap(ads);
        ZERO_STRUCT(ads->ldap_wrap_data);
 }