Commit fe9e2399 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

crypt32: Don't call CertFreeCertificateContext in CertDeleteCertificateContext,…

crypt32: Don't call CertFreeCertificateContext in CertDeleteCertificateContext, leave it to store-specific functions.
parent 52b2add3
......@@ -271,15 +271,9 @@ static BOOL Collection_deleteCert(WINECRYPT_CERTSTORE *store, void *pCertContext
TRACE("(%p, %p)\n", store, pCertContext);
/* Deleting the linked context results in its ref count getting
* decreased, but the caller of this (CertDeleteCertificateFromStore) also
* decreases pCertContext's ref count, by calling
* CertFreeCertificateContext. Increase ref count of linked context to
* compensate.
*/
linked = Context_GetLinkedContext(pCertContext);
CertDuplicateCertificateContext(linked);
ret = CertDeleteCertificateFromStore(linked);
CertFreeCertificateContext(pCertContext);
return ret;
}
......@@ -356,14 +350,9 @@ static BOOL Collection_deleteCRL(WINECRYPT_CERTSTORE *store, void *pCrlContext)
TRACE("(%p, %p)\n", store, pCrlContext);
/* Deleting the linked context results in its ref count getting
* decreased, but the caller of this (CertDeleteCRLFromStore) also
* decreases pCrlContext's ref count, by calling CertFreeCRLContext.
* Increase ref count of linked context to compensate.
*/
linked = Context_GetLinkedContext(pCrlContext);
CertDuplicateCRLContext(linked);
ret = CertDeleteCRLFromStore(linked);
CertFreeCRLContext(pCrlContext);
return ret;
}
......@@ -432,22 +421,16 @@ static void *Collection_enumCTL(WINECRYPT_CERTSTORE *store, void *pPrev)
return ret;
}
static BOOL Collection_deleteCTL(WINECRYPT_CERTSTORE *store,
void *pCtlContext)
static BOOL Collection_deleteCTL(WINECRYPT_CERTSTORE *store, void *pCtlContext)
{
BOOL ret;
PCCTL_CONTEXT linked;
TRACE("(%p, %p)\n", store, pCtlContext);
/* Deleting the linked context results in its ref count getting
* decreased, but the caller of this (CertDeleteCTLFromStore) also
* decreases pCtlContext's ref count, by calling CertFreeCTLContext.
* Increase ref count of linked context to compensate.
*/
linked = Context_GetLinkedContext(pCtlContext);
CertDuplicateCTLContext(linked);
ret = CertDeleteCTLFromStore(linked);
CertFreeCTLContext(pCtlContext);
return ret;
}
......
......@@ -1060,15 +1060,10 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
ret = FALSE;
else
ret = hcs->vtbl->certs.deleteContext(hcs, (void *)pCertContext);
if (ret)
ret = CertFreeCertificateContext(pCertContext);
}
return ret;
}
#define CrlContext_CopyProperties(to, from) \
Context_CopyProperties((to), (from), sizeof(CRL_CONTEXT))
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
PCCRL_CONTEXT* ppStoreContext)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment