From ced404a0d53f3fdb7660bb214e019da4fdc27591 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sat, 6 Sep 2025 08:28:12 +0000 Subject: [PATCH] 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. --- src/acl/external/AD_group/ext_ad_group_acl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. */ -- 2.47.3