From: Neil Horman Date: Fri, 17 Jul 2026 17:04:29 +0000 (-0400) Subject: Add return check to OSSL_DECODER_up_ref X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eac8ed4825213a80644bb5ea15234a59daa57352;p=thirdparty%2Fopenssl.git Add return check to OSSL_DECODER_up_ref Coverity flagged a location where we didn't check this return code, fix it up. Fixes https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1696759 Reviewed-by: Milan Broz Reviewed-by: Andrew Dinh Reviewed-by: Nikola Pajkovsky Reviewed-by: Norbert Pocs MergeDate: Thu Jul 23 08:24:22 2026 (Merged from https://github.com/openssl/openssl/pull/31992) --- diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c index 03118f5843b..632d20c996a 100644 --- a/crypto/encode_decode/decoder_meth.c +++ b/crypto/encode_decode/decoder_meth.c @@ -415,7 +415,10 @@ inner_ossl_decoder_fetch(struct decoder_data_st *methdata, * lives beyond the freeing of that tmp_store */ #ifndef OPENSSL_NO_CACHED_FETCH - OSSL_DECODER_up_ref((OSSL_DECODER *)method); + if (!OSSL_DECODER_up_ref((OSSL_DECODER *)method)) { + ossl_decoder_free(method); + method = NULL; + } #endif } }