diff options
author | Matt Caswell <matt@openssl.org> | 2023-08-15 15:05:38 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-08-17 08:06:43 +0100 |
commit | e16c0103083af676af8c5564bb21585d4574f992 (patch) | |
tree | 2139159931116326a968a63b1dff70ca523883ce /crypto | |
parent | e4d808652b0a1a19cfe615a6659e65ead0245108 (diff) | |
download | openssl-e16c0103083af676af8c5564bb21585d4574f992.tar.gz |
Fix a leak in an error path when duplicating an OSSL_DECODER_CTX.
Make sure we free process_data_dest if it is not actually used.
Found by the reproducible error patch in #21668
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21741)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/encode_decode/decoder_pkey.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index 65dc1326e2..c38c7e3dff 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -579,6 +579,7 @@ ossl_decoder_ctx_for_pkey_dup(OSSL_DECODER_CTX *src, if (process_data_dest != NULL) { OPENSSL_free(process_data_dest->propq); sk_EVP_KEYMGMT_pop_free(process_data_dest->keymgmts, EVP_KEYMGMT_free); + OPENSSL_free(process_data_dest); } OSSL_DECODER_CTX_free(dest); return NULL; |