From: Kevin Jones Date: Sun, 23 Jul 2023 03:42:40 +0000 (-0400) Subject: Properly close PKCS12 files when enumerating stores X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~833 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d40ca00ca2fb5411ff159b2e84b800e8dfbd681e;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Properly close PKCS12 files when enumerating stores --- diff --git a/src/native/libs/System.Security.Cryptography.Native/pal_x509.c b/src/native/libs/System.Security.Cryptography.Native/pal_x509.c index 5dbd1bd..40f7c60 100644 --- a/src/native/libs/System.Security.Cryptography.Native/pal_x509.c +++ b/src/native/libs/System.Security.Cryptography.Native/pal_x509.c @@ -353,7 +353,7 @@ int32_t CryptoNative_X509StoreCtxRebuildChain(X509_STORE_CTX* ctx) int32_t CryptoNative_X509StoreCtxSetVerifyCallback(X509_STORE_CTX* ctx, X509StoreVerifyCallback callback, void* appData) { ERR_clear_error(); - + X509_STORE_CTX_set_verify_cb(ctx, callback); return X509_STORE_CTX_set_app_data(ctx, appData); @@ -527,6 +527,10 @@ static X509* ReadNextPublicCert(DIR* dir, X509Stack* tmpStack, char* pathTmp, si return cert; } } + else + { + fclose(fp); + } } } }