From: Jeremy Allison Date: Sat, 8 Aug 2020 03:24:07 +0000 (-0700) Subject: s3: libads: In ads_connect(), and ads_disconnect(), replace ZERO_STRUCT(ads->ldap... X-Git-Tag: talloc-2.3.2~822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b47f3dbbcdb692e46237aa1d9aeeb944a78b308;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andreas Schneider --- diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 18e2b86fb8e..33bf3aebf29 100755 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -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); }