d2i_PrivateKey_decoder(): Fix premature exit on unsuccessful OSSL_DECODER_CTX_new_for_pkey()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14647)
This commit is contained in:
Dr. David von Oheimb 2021-03-25 16:20:48 +01:00 committed by Dr. David von Oheimb
parent 4957d95208
commit 6d9e045ef7

View File

@ -52,7 +52,7 @@ d2i_PrivateKey_decoder(int keytype, EVP_PKEY **a, const unsigned char **pp,
if (a != NULL)
*a = bak_a;
if (dctx == NULL)
return NULL;
continue;
ret = OSSL_DECODER_from_data(dctx, pp, &len);
OSSL_DECODER_CTX_free(dctx);