Skip to content

Commit

Permalink
8303607: SunMSCAPI provider leaks memory and keys
Browse files Browse the repository at this point in the history
Backport-of: a393f2581740f854518a3ef7caccd6d3c2d8e4a0
  • Loading branch information
Mat Carter authored and Paul Hohensee committed Oct 12, 2023
1 parent 363855d commit 94d3648
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,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 94d3648

@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.