From: JiashengJiang Date: Fri, 16 May 2025 18:21:07 +0000 (-0400) Subject: crypto/property/property.c: Free impl->method to avoid memory leak X-Git-Tag: openssl-3.3.4~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e44317a383f7d36e195158da6aef5674c83eeec7;p=thirdparty%2Fopenssl.git crypto/property/property.c: Free impl->method to avoid memory leak After ossl_method_up_ref() succeeds, impl_free() should be called to free impl->method. Fixes: 860ecfd ("property: check return values from the property locking calls.") Signed-off-by: JiashengJiang Reviewed-by: Matt Caswell Reviewed-by: Nicola Tuveri Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27564) (cherry picked from commit 00c531a5e327320f0ec78ce4b153fac65ebca229) --- diff --git a/crypto/property/property.c b/crypto/property/property.c index 55e990bdbf3..0d7bc6994ff 100644 --- a/crypto/property/property.c +++ b/crypto/property/property.c @@ -321,7 +321,7 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov, /* Insert into the hash table if required */ if (!ossl_property_write_lock(store)) { - OPENSSL_free(impl); + impl_free(impl); return 0; } ossl_method_cache_flush(store, nid);