Skip to content

Commit

Permalink
8303607: SunMSCAPI provider leaks memory and keys
Browse files Browse the repository at this point in the history
Reviewed-by: weijun
  • Loading branch information
Mat Carter authored and wangweij committed Mar 7, 2023
1 parent f64ed09 commit c51d40c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

1 comment on commit c51d40c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.