mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s3: libads: In ads_connect(), and ads_disconnect(), replace ZERO_STRUCT(ads->ldap) with calls to ads_zero_ldap(ads)
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>
This commit is contained in:
parent
61895749f5
commit
6b47f3dbbc
@ -595,7 +595,7 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
|
|||||||
NTSTATUS ntstatus;
|
NTSTATUS ntstatus;
|
||||||
char addr[INET6_ADDRSTRLEN];
|
char addr[INET6_ADDRSTRLEN];
|
||||||
|
|
||||||
ZERO_STRUCT(ads->ldap);
|
ads_zero_ldap(ads);
|
||||||
ZERO_STRUCT(ads->ldap_wrap_data);
|
ZERO_STRUCT(ads->ldap_wrap_data);
|
||||||
ads->ldap.last_attempt = time_mono(NULL);
|
ads->ldap.last_attempt = time_mono(NULL);
|
||||||
ads->ldap_wrap_data.wrap_type = ADS_SASLWRAP_TYPE_PLAIN;
|
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) {
|
if (ads->ldap_wrap_data.mem_ctx) {
|
||||||
talloc_free(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);
|
ZERO_STRUCT(ads->ldap_wrap_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user