diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index bec5cf9df1..7ae6fd97d1 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -593,12 +593,15 @@ QCryptographicHashPrivate::EVP::EVP(QCryptographicHash::Algorithm method) * algorithm available. */ legacyProvider = OSSL_PROVIDER_ptr(OSSL_PROVIDER_load(nullptr, "legacy")); - defaultProvider = OSSL_PROVIDER_ptr(OSSL_PROVIDER_load(nullptr, "default")); - if (!legacyProvider || !defaultProvider) + if (!legacyProvider) return; } + defaultProvider = OSSL_PROVIDER_ptr(OSSL_PROVIDER_load(nullptr, "default")); + if (!defaultProvider) + return; + context = EVP_MD_CTX_ptr(EVP_MD_CTX_new()); if (!context) {