mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
crypt32: Don't call CertFreeCertificateContext in CertDeleteCertificateContext, leave it to store-specific functions.
This commit is contained in:
parent
52b2add395
commit
fe9e23998a
@ -271,15 +271,9 @@ static BOOL Collection_deleteCert(WINECRYPT_CERTSTORE *store, void *pCertContext
|
|||||||
|
|
||||||
TRACE("(%p, %p)\n", store, 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);
|
linked = Context_GetLinkedContext(pCertContext);
|
||||||
CertDuplicateCertificateContext(linked);
|
|
||||||
ret = CertDeleteCertificateFromStore(linked);
|
ret = CertDeleteCertificateFromStore(linked);
|
||||||
|
CertFreeCertificateContext(pCertContext);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,14 +350,9 @@ static BOOL Collection_deleteCRL(WINECRYPT_CERTSTORE *store, void *pCrlContext)
|
|||||||
|
|
||||||
TRACE("(%p, %p)\n", store, 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);
|
linked = Context_GetLinkedContext(pCrlContext);
|
||||||
CertDuplicateCRLContext(linked);
|
|
||||||
ret = CertDeleteCRLFromStore(linked);
|
ret = CertDeleteCRLFromStore(linked);
|
||||||
|
CertFreeCRLContext(pCrlContext);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,22 +421,16 @@ static void *Collection_enumCTL(WINECRYPT_CERTSTORE *store, void *pPrev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL Collection_deleteCTL(WINECRYPT_CERTSTORE *store,
|
static BOOL Collection_deleteCTL(WINECRYPT_CERTSTORE *store, void *pCtlContext)
|
||||||
void *pCtlContext)
|
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
PCCTL_CONTEXT linked;
|
PCCTL_CONTEXT linked;
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", store, pCtlContext);
|
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);
|
linked = Context_GetLinkedContext(pCtlContext);
|
||||||
CertDuplicateCTLContext(linked);
|
|
||||||
ret = CertDeleteCTLFromStore(linked);
|
ret = CertDeleteCTLFromStore(linked);
|
||||||
|
CertFreeCTLContext(pCtlContext);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1060,15 +1060,10 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
|
|||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
else
|
else
|
||||||
ret = hcs->vtbl->certs.deleteContext(hcs, (void *)pCertContext);
|
ret = hcs->vtbl->certs.deleteContext(hcs, (void *)pCertContext);
|
||||||
if (ret)
|
|
||||||
ret = CertFreeCertificateContext(pCertContext);
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CrlContext_CopyProperties(to, from) \
|
|
||||||
Context_CopyProperties((to), (from), sizeof(CRL_CONTEXT))
|
|
||||||
|
|
||||||
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
|
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
|
||||||
PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
|
PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
|
||||||
PCCRL_CONTEXT* ppStoreContext)
|
PCCRL_CONTEXT* ppStoreContext)
|
||||||
|
Loading…
Reference in New Issue
Block a user