8303607: SunMSCAPI provider leaks memory and keys
Reviewed-by: weijun
This commit is contained in:
parent
f64ed09e9a
commit
c51d40cfeb
@ -523,7 +523,11 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC
|
||||
else
|
||||
{
|
||||
if (bCallerFreeProv == TRUE) {
|
||||
::CryptReleaseContext(hCryptProv, NULL); // deprecated
|
||||
if ((dwKeySpec & CERT_NCRYPT_KEY_SPEC) == CERT_NCRYPT_KEY_SPEC) {
|
||||
NCryptFreeObject(hCryptProv);
|
||||
} else {
|
||||
::CryptReleaseContext(hCryptProv, NULL); // deprecated
|
||||
}
|
||||
bCallerFreeProv = FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user