From: Eugene Syromiatnikov Date: Thu, 31 Jul 2025 12:23:44 +0000 (+0200) Subject: crypto/mem.c: simplify OPENSSL_SMALL_FOOTPRINT handling in CRYPTO_aligned_alloc X-Git-Tag: openssl-3.6.0-alpha1~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b742083e37f4d9674f0bf1078cc1cada46d8108;p=thirdparty%2Fopenssl.git crypto/mem.c: simplify OPENSSL_SMALL_FOOTPRINT handling in CRYPTO_aligned_alloc There is no need to initialise neither *freeptr, as it is initialised already, nor ret, as NULL can be simply returned instead. Signed-off-by: Eugene Syromiatnikov Reviewed-by: Saša Nedvědický Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/28059) --- diff --git a/crypto/mem.c b/crypto/mem.c index c0dffbfdad6..161d61dae63 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -236,8 +236,7 @@ void *CRYPTO_aligned_alloc(size_t num, size_t alignment, void **freeptr, *freeptr = NULL; #if defined(OPENSSL_SMALL_FOOTPRINT) - ret = *freeptr = NULL; - return ret; + return NULL; #endif /* Allow non-malloc() allocations as long as no malloc_impl is provided. */