Commit dd91e541 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

crypt32: Correctly free memory in CNG_ImportRSAPubKey().

parent f9d83842
......@@ -2720,7 +2720,7 @@ static BOOL CNG_ImportRSAPubKey(CERT_PUBLIC_KEY_INFO *info, BCRYPT_KEY_HANDLE *k
else
{
FIXME("Unsupported RSA algorithm: %#x\n", hdr->aiKeyAlg);
CryptMemFree(hdr);
LocalFree(hdr);
SetLastError(NTE_BAD_ALGID);
return FALSE;
}
......@@ -2762,7 +2762,7 @@ static BOOL CNG_ImportRSAPubKey(CERT_PUBLIC_KEY_INFO *info, BCRYPT_KEY_HANDLE *k
CryptMemFree(rsakey);
done:
CryptMemFree(hdr);
LocalFree(hdr);
if (alg) BCryptCloseAlgorithmProvider(alg, 0);
if (status) SetLastError(RtlNtStatusToDosError(status));
return !status;
......@@ -2773,7 +2773,6 @@ BOOL CNG_ImportPubKey(CERT_PUBLIC_KEY_INFO *pubKeyInfo, BCRYPT_KEY_HANDLE *key)
if (!strcmp(pubKeyInfo->Algorithm.pszObjId, szOID_ECC_PUBLIC_KEY))
return CNG_ImportECCPubKey(pubKeyInfo, key);
if (!strcmp(pubKeyInfo->Algorithm.pszObjId, szOID_RSA_RSA))
return CNG_ImportRSAPubKey(pubKeyInfo, key);
......
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