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)
impl->properties = ossl_parse_property(store->ctx, properties);
if (impl->properties == NULL)
goto err;
- ossl_prop_defn_set(store->ctx, properties, impl->properties);
+ if (!ossl_prop_defn_set(store->ctx, properties, impl->properties)) {
+ ossl_property_free(impl->properties);
+ impl->properties = NULL;
+ goto err;
+ }
}
alg = ossl_method_store_retrieve(store, nid);