Fix a possible memory leak in ossl_x509_algor_md_to_mgf1
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 10 Dec 2023 14:21:19 +0000 (15:21 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 19 Dec 2023 17:33:03 +0000 (18:33 +0100)
commit493d6c9ab37b18b110c977a2bc896f06b18f6065
tree6f461563ca44fdbbf7a0b97a84dc25c05980f805
parent201711c15836fc6b14cc87e1687c3c2411ad84b8
Fix a possible memory leak in ossl_x509_algor_md_to_mgf1

Add a missing check of the return code of X509_ALGOR_set0.
otherwise a memory leak may occur.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22999)
crypto/asn1/x_algor.c