Commit 92324ab3 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Propagate errors from CertFree*Context to CertDelete*FromStore.

parent 40855cae
...@@ -309,10 +309,7 @@ BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext) ...@@ -309,10 +309,7 @@ BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
if (!pCtlContext) if (!pCtlContext)
ret = TRUE; ret = TRUE;
else if (!pCtlContext->hCertStore) else if (!pCtlContext->hCertStore)
{ ret = CertFreeCTLContext(pCtlContext);
ret = TRUE;
CertFreeCTLContext(pCtlContext);
}
else else
{ {
PWINECRYPT_CERTSTORE hcs = pCtlContext->hCertStore; PWINECRYPT_CERTSTORE hcs = pCtlContext->hCertStore;
...@@ -321,7 +318,8 @@ BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext) ...@@ -321,7 +318,8 @@ BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
ret = FALSE; ret = FALSE;
else else
ret = hcs->ctls.deleteContext(hcs, (void *)pCtlContext); ret = hcs->ctls.deleteContext(hcs, (void *)pCtlContext);
CertFreeCTLContext(pCtlContext); if (ret)
ret = CertFreeCTLContext(pCtlContext);
} }
return ret; return ret;
} }
......
...@@ -966,10 +966,7 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext) ...@@ -966,10 +966,7 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
if (!pCertContext) if (!pCertContext)
ret = TRUE; ret = TRUE;
else if (!pCertContext->hCertStore) else if (!pCertContext->hCertStore)
{ ret = CertFreeCertificateContext(pCertContext);
ret = TRUE;
CertFreeCertificateContext(pCertContext);
}
else else
{ {
PWINECRYPT_CERTSTORE hcs = pCertContext->hCertStore; PWINECRYPT_CERTSTORE hcs = pCertContext->hCertStore;
...@@ -979,7 +976,7 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext) ...@@ -979,7 +976,7 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
else else
ret = hcs->certs.deleteContext(hcs, (void *)pCertContext); ret = hcs->certs.deleteContext(hcs, (void *)pCertContext);
if (ret) if (ret)
CertFreeCertificateContext(pCertContext); ret = CertFreeCertificateContext(pCertContext);
} }
return ret; return ret;
} }
...@@ -1105,10 +1102,7 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext) ...@@ -1105,10 +1102,7 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
if (!pCrlContext) if (!pCrlContext)
ret = TRUE; ret = TRUE;
else if (!pCrlContext->hCertStore) else if (!pCrlContext->hCertStore)
{ ret = CertFreeCRLContext(pCrlContext);
ret = TRUE;
CertFreeCRLContext(pCrlContext);
}
else else
{ {
PWINECRYPT_CERTSTORE hcs = pCrlContext->hCertStore; PWINECRYPT_CERTSTORE hcs = pCrlContext->hCertStore;
...@@ -1117,7 +1111,8 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext) ...@@ -1117,7 +1111,8 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
ret = FALSE; ret = FALSE;
else else
ret = hcs->crls.deleteContext(hcs, (void *)pCrlContext); ret = hcs->crls.deleteContext(hcs, (void *)pCrlContext);
CertFreeCRLContext(pCrlContext); if (ret)
ret = CertFreeCRLContext(pCrlContext);
} }
return ret; return ret;
} }
......
...@@ -237,6 +237,7 @@ static void testMemStore(void) ...@@ -237,6 +237,7 @@ static void testMemStore(void)
GetLastError()); GetLastError());
/* try deleting a copy */ /* try deleting a copy */
ret = CertDeleteCertificateFromStore(copy); ret = CertDeleteCertificateFromStore(copy);
todo_wine
ok(ret, "CertDeleteCertificateFromStore failed: %08x\n", ok(ret, "CertDeleteCertificateFromStore failed: %08x\n",
GetLastError()); GetLastError());
/* check that the store is empty */ /* check that the store is empty */
......
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