]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/mem.c: simplify OPENSSL_SMALL_FOOTPRINT handling in CRYPTO_aligned_alloc
authorEugene Syromiatnikov <esyr@openssl.org>
Thu, 31 Jul 2025 12:23:44 +0000 (14:23 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 8 Aug 2025 16:22:10 +0000 (12:22 -0400)
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 <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28059)

crypto/mem.c

index c0dffbfdad6bf79424869b6196c146c83d9452b3..161d61dae6365beb6ef79a80359d3269f83c8b94 100644 (file)
@@ -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. */