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: c51d40cfebe793b2e979db0f2d91ac3b136311bb
  • Loading branch information
Mat Carter authored and Paul Hohensee committed Oct 9, 2023
1 parent d7e22e8 commit a393f25
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 a393f25

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