Hans Leidekker : crypt32: Correctly free memory in CNG_ImportRSAPubKey().

Alexandre Julliard julliard at winehq.org
Wed Mar 30 15:43:56 CDT 2022


Module: wine
Branch: master
Commit: dd91e541b66a0c0cba404c760bfbc7a661661dc7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=dd91e541b66a0c0cba404c760bfbc7a661661dc7

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Mar 30 11:47:44 2022 +0200

crypt32: Correctly free memory in CNG_ImportRSAPubKey().

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/crypt32/cert.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index 33811dfadc1..b7789fd6fcd 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -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);
 




More information about the wine-cvs mailing list