本文整理汇总了C++中VMAFD_SAFE_FREE_MEMORY函数的典型用法代码示例。如果您正苦于以下问题:C++ VMAFD_SAFE_FREE_MEMORY函数的具体用法?C++ VMAFD_SAFE_FREE_MEMORY怎么用?C++ VMAFD_SAFE_FREE_MEMORY使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VMAFD_SAFE_FREE_MEMORY函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VmAfdCheckCertOnDisk
static
DWORD
VmAfdCheckCertOnDisk(
PCSTR pszAlias,
PCSTR pszCAPath,
PCSTR pszFilename,
LONG maxIndex,
PBOOLEAN pbCertOnDisk
)
{
DWORD dwError = 0;
LONG index = 0;
BOOLEAN bCertOnDisk = FALSE;
PSTR pszPath = NULL;
PSTR pszAliasOther = NULL;
// Note : maxIndex starts from 0
for (; !bCertOnDisk && (index <= maxIndex); index++)
{
VMAFD_SAFE_FREE_MEMORY(pszPath);
dwError = VmAfdAllocateStringPrintf(
&pszPath,
"%s%s%s.%ld",
pszCAPath,
VMAFD_PATH_SEPARATOR_STR,
pszFilename,
index);
BAIL_ON_VMAFD_ERROR(dwError);
VMAFD_SAFE_FREE_MEMORY(pszAliasOther);
dwError = VecsComputeCertAliasFile(pszPath, &pszAliasOther);
BAIL_ON_VMAFD_ERROR(dwError);
if (!VmAfdStringCompareA(pszAlias, pszAliasOther, FALSE))
{
bCertOnDisk = TRUE;
}
}
*pbCertOnDisk = bCertOnDisk;
cleanup:
VMAFD_SAFE_FREE_MEMORY(pszPath);
VMAFD_SAFE_FREE_MEMORY(pszAliasOther);
return dwError;
error:
*pbCertOnDisk = FALSE;
goto cleanup;
}
示例2: VmAfdFreeSuperLogEntryArray
VOID
VmAfdFreeSuperLogEntryArray(
PVMAFD_SUPERLOG_ENTRY_ARRAY pEntries
)
{
if (pEntries)
{
VMAFD_SAFE_FREE_MEMORY(pEntries->entries);
VMAFD_SAFE_FREE_MEMORY(pEntries);
}
}
示例3: VmAfdFreeHbNode
VOID
VmAfdFreeHbNode(
PVMAFD_HB_NODE pNode
)
{
if (pNode)
{
VMAFD_SAFE_FREE_MEMORY(pNode->pszServiceName);
VMAFD_SAFE_FREE_MEMORY(pNode);
}
}
示例4: VecsDbFreeCertEntryContents
VOID
VecsDbFreeCertEntryContents(
PVECS_DB_CERTIFICATE_ENTRY pCertEntry
)
{
VMAFD_SAFE_FREE_MEMORY(pCertEntry->pwszAlias);
VMAFD_SAFE_FREE_MEMORY(pCertEntry->pwszSerial);
VMAFD_SAFE_FREE_MEMORY(pCertEntry->pCertBlob);
VMAFD_SAFE_FREE_MEMORY(pCertEntry->pwszPassword);
VMAFD_SAFE_FREE_MEMORY(pCertEntry->pPrivateKey);
}
示例5: DirCliFreeCert
VOID
DirCliFreeCert(
PDIR_CLI_CERT pCert
)
{
VMAFD_SAFE_FREE_MEMORY(pCert->pszSubjectName);
VMAFD_SAFE_FREE_MEMORY(pCert->pszFingerPrint);
if (pCert->pX509Cert)
{
X509_free(pCert->pX509Cert);
}
VmAfdFreeMemory(pCert);
}
示例6: VmAfSrvConfigureDNSW
DWORD
VmAfSrvConfigureDNSW(
PCWSTR pwszServerName,
PCWSTR pwszDomainName,
PCWSTR pwszUserName,
PCWSTR pwszPassword
)
{
DWORD dwError = 0;
PSTR pszServerName = NULL;
PSTR pszDomainName = NULL;
PSTR pszUserName = NULL;
PSTR pszPassword = NULL;
dwError = VmAfdAllocateStringAFromW(
pwszServerName,
&pszServerName);
BAIL_ON_VMAFD_ERROR(dwError);
dwError = VmAfdAllocateStringAFromW(
pwszDomainName,
&pszDomainName);
BAIL_ON_VMAFD_ERROR(dwError);
dwError = VmAfdAllocateStringAFromW(
pwszUserName,
&pszUserName);
BAIL_ON_VMAFD_ERROR(dwError);
dwError = VmAfdAllocateStringAFromW(
pwszPassword,
&pszPassword);
BAIL_ON_VMAFD_ERROR(dwError);
dwError = VmAfSrvConfigureDNSA(
pszServerName,
pszDomainName,
pszUserName,
pszPassword);
BAIL_ON_VMAFD_ERROR(dwError);
error:
VMAFD_SAFE_FREE_MEMORY(pszServerName);
VMAFD_SAFE_FREE_MEMORY(pszDomainName);
VMAFD_SAFE_FREE_MEMORY(pszUserName);
VMAFD_SAFE_FREE_MEMORY(pszPassword);
return dwError;
}
示例7: VmAfdTearDownStoreHashMap
VOID
VmAfdTearDownStoreHashMap (
VOID
)
{
DWORD dwIndex = 0;
BOOLEAN bIsHoldingLock = FALSE;
VMAFD_LOCK_MUTEX_EXCLUSIVE (&gVmafdGlobals.rwlockStoreMap, bIsHoldingLock);
for (; dwIndex < VECS_STOREHASH_MAP_SIZE; dwIndex++)
{
VECS_SRV_STORE_MAP storeMapEntry = gVecsGlobalStoreMap[dwIndex];
VMAFD_SAFE_FREE_MEMORY (storeMapEntry.pStore);
if (storeMapEntry.pSecurityDescriptor)
{
VmAfdFreeSecurityDescriptor (storeMapEntry.pSecurityDescriptor);
}
if (storeMapEntry.pStoreContextList)
{
VmAfdFreeContextList(storeMapEntry.pStoreContextList);
}
gVecsGlobalStoreMap[dwIndex].status = STORE_MAP_ENTRY_STATUS_EMPTY;
}
VMAFD_LOCK_MUTEX_UNLOCK (&gVmafdGlobals.rwlockStoreMap, bIsHoldingLock);
}
示例8: CdcUpdateAffinitizedDC
static
DWORD
CdcUpdateAffinitizedDC(
PWSTR pszNewDCName
)
{
DWORD dwError = 0;
PWSTR pszDomainName = NULL;
dwError = VmAfSrvGetDomainName(&pszDomainName);
BAIL_ON_VMAFD_ERROR(dwError);
dwError = CdcDbAddAffinitizedDC(
pszNewDCName,
pszDomainName
);
BAIL_ON_VMAFD_ERROR(dwError);
cleanup:
VMAFD_SAFE_FREE_MEMORY(pszDomainName);
return dwError;
error:
goto cleanup;
}
示例9: CdcHandleNoDCsAlive
static
DWORD
CdcHandleNoDCsAlive(
VOID
)
{
DWORD dwError = 0;
PWSTR pszNextDCName = NULL;
CDC_DC_STATE cdcNextState = CDC_DC_STATE_NO_DCS_ALIVE;
dwError = CdcGetNewDC(&pszNextDCName, &cdcNextState);
BAIL_ON_VMAFD_ERROR(dwError);
if (cdcNextState != CDC_DC_STATE_NO_DCS_ALIVE)
{
dwError = CdcUpdateAffinitizedDC(
pszNextDCName
);
BAIL_ON_VMAFD_ERROR(dwError);
dwError = CdcStateTransition(cdcNextState);
BAIL_ON_VMAFD_ERROR(dwError);
}
cleanup:
VMAFD_SAFE_FREE_MEMORY(pszNextDCName);
return dwError;
error:
goto cleanup;
}
示例10: CdcGetClientSiteName
static
DWORD
CdcGetClientSiteName(
PWSTR* ppszSiteName
)
{
DWORD dwError = 0;
PWSTR pszSiteName = NULL;
if (!ppszSiteName)
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMAFD_ERROR(dwError);
}
dwError = CdcRegDbGetSiteName(&pszSiteName);
BAIL_ON_VMAFD_ERROR(dwError);
*ppszSiteName = pszSiteName;
cleanup:
return dwError;
error:
if (ppszSiteName)
{
*ppszSiteName = NULL;
}
VMAFD_SAFE_FREE_MEMORY(pszSiteName);
goto cleanup;
}
示例11: CdcShutdownThread
VOID
CdcShutdownThread(
PCDC_THREAD_CONTEXT pThrContext,
PSTR pszThreadName
)
{
DWORD dwError = 0;
if (pThrContext && pThrContext->pThread)
{
CdcSetShutdownFlagThread(pThrContext);
dwError = pthread_cond_signal(&pThrContext->thr_cond);
if (dwError)
{
VmAfdLog(
VMAFD_DEBUG_ANY,
"Condition Signalling %s failed. Error [%d]",
IsNullOrEmptyString(pszThreadName)?"":pszThreadName,
dwError
);
dwError = 0;
}
pthread_cond_destroy(&pThrContext->thr_cond);
pthread_mutex_destroy(&pThrContext->thr_mutex);
}
VMAFD_SAFE_FREE_MEMORY(pThrContext);
}
示例12: _VmAfdWriteSuperlogEntryToEventLog
static
DWORD
_VmAfdWriteSuperlogEntryToEventLog(
PVMAFD_SUPERLOG_ENTRY superlogEntry
)
{
DWORD dwError = 0;
PCSTR pszDelimiter = "||";
PSTR pszMarshalledEntry = NULL;
dwError = VmAfdAllocateStringPrintf(
&pszMarshalledEntry,
"%u%s%u%s%u%s%lu%s",
superlogEntry->dwErrorCode, pszDelimiter,
superlogEntry->dwCDCLastPing, pszDelimiter,
superlogEntry->iStartTime, pszDelimiter,
superlogEntry->iEndTime, pszDelimiter
);
BAIL_ON_VMAFD_ERROR(dwError);
cleanup:
VMAFD_SAFE_FREE_MEMORY(pszMarshalledEntry);
return dwError;
error:
goto cleanup;
}
示例13: VmAfdSrvFlushRoot_SHA_1
static
DWORD
VmAfdSrvFlushRoot_SHA_1(
PCSTR pszCertificate,
PCSTR pszCAPath
)
{
DWORD dwError = 0;
PSTR pszHash = NULL;
dwError = VecsComputeCertHash_SHA_1((PSTR)pszCertificate, &pszHash);
BAIL_ON_VMAFD_ERROR(dwError);
dwError = VmAfdSrvWriteRootToDisk(pszCertificate, pszCAPath, pszHash);
BAIL_ON_VMAFD_ERROR(dwError);
cleanup:
VMAFD_SAFE_FREE_MEMORY(pszHash);
return dwError;
error:
goto cleanup;
}
示例14: BAIL_ON_ERROR
std::string client::GetCertByAlias(
opaque Store,
std::string Alias)
{
DWORD dwError = 0;
PSTR pszAlias = NULL;
PSTR pszCertificate = NULL;
PVECS_STORE pStore = NULL;
std::string result;
if (Alias.length() <= 0)
{
dwError = VECS_NO_CERT_FOUND;
BAIL_ON_ERROR(dwError);
}
pStore = (PVECS_STORE)Store;
dwError = VecsGetCertificateByAliasA(
pStore,
(PSTR)Alias.c_str(),
&pszCertificate);
BAIL_ON_ERROR(dwError);
result.assign(pszCertificate);
cleanup:
VMAFD_SAFE_FREE_MEMORY(pszCertificate);
return result;
error:
THROW_IF_NEEDED(dwError);
goto cleanup;
}
示例15: VmAfdFreeSecurityContextImpl
VOID
VmAfdFreeSecurityContextImpl(
PVM_AFD_SECURITY_CONTEXT pSecurityContext
)
{
VMAFD_SAFE_FREE_MEMORY (pSecurityContext);
}