diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c index 5a27bf00ecaa00..f57eaa3bad0686 100644 --- a/apps/pkeyutl.c +++ b/apps/pkeyutl.c @@ -662,6 +662,7 @@ static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize, else ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, propq); EVP_PKEY_free(pkey); + pkey = NULL; } if (ctx == NULL)