diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc index c99cf2fb23619a..55ea3a61ccc0b2 100644 --- a/src/crypto/crypto_dh.cc +++ b/src/crypto/crypto_dh.cc @@ -454,10 +454,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) { if (!dh) return {}; key_params = EVPKeyPointer::NewDH(std::move(dh)); - } else if (std::get_if(¶ms->params.prime)) { + } else if (int* prime_size = std::get_if(¶ms->params.prime)) { auto param_ctx = EVPKeyCtxPointer::NewFromID(EVP_PKEY_DH); #ifndef OPENSSL_IS_BORINGSSL - int* prime_size = std::get_if(¶ms->params.prime); if (!param_ctx.initForParamgen() || !param_ctx.setDhParameters(*prime_size, params->params.generator)) { return {};