Fix a memory leak in ossl_method_store_add()
authorMatt Caswell <matt@openssl.org>
Thu, 2 Jun 2022 10:14:32 +0000 (11:14 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 9 Jun 2022 10:37:31 +0000 (11:37 +0100)
commitfed8dbea27b7e01ee934951b25c6ffd40ad1d5c3
treeb00a817b669899fd13b9e4e95647644e82c7527c
parent9cef2a70b151b6a92eb1770ceb5fa90331305934
Fix a memory leak in ossl_method_store_add()

If the call to ossl_prop_defn_set() fails then the OSSL_PROPERTY_LIST
we just created will leak.

Found as a result of:
https://github.com/openssl/openssl/pull/18355#issuecomment-1139499881

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18458)
crypto/property/property.c