From: Joshua Rogers Date: Sat, 6 Sep 2025 08:28:12 +0000 (+0000) Subject: ext_ad_group_acl: Fix domain lookup error handling (#2180) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ced404a0d53f3fdb7660bb214e019da4fdc27591;p=thirdparty%2Fsquid.git ext_ad_group_acl: Fix domain lookup error handling (#2180) On errors, the helper was reporting DsRoleGetPrimaryDomainInformation() error info using the wrong/bogus error code and probably freeing an uninitialized pointer. --- diff --git a/src/acl/external/AD_group/ext_ad_group_acl.cc b/src/acl/external/AD_group/ext_ad_group_acl.cc index 610059a23b..8b0d3ac89d 100644 --- a/src/acl/external/AD_group/ext_ad_group_acl.cc +++ b/src/acl/external/AD_group/ext_ad_group_acl.cc @@ -320,10 +320,10 @@ static char * GetDomainName(void) { static char *DomainName = nullptr; - PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo; + PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo = nullptr; DWORD netret; - if ((netret = DsRoleGetPrimaryDomainInformation(nullptr, DsRolePrimaryDomainInfoBasic, (PBYTE *) & pDSRoleInfo) == ERROR_SUCCESS)) { + if ((netret = DsRoleGetPrimaryDomainInformation(nullptr, DsRolePrimaryDomainInfoBasic, (PBYTE *) & pDSRoleInfo)) == ERROR_SUCCESS) { /* * Check the machine role. */