From 8fed6e5b4627994f6393ba5220710091f89f66e8 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 16 Dec 2017 13:04:59 +0100 Subject: [PATCH] We really don't need an intermediate variable here --- src/libsodium/sodium/utils.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 85aad292..b9a85944 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -573,15 +573,11 @@ sodium_malloc(const size_t size) __attribute__((malloc)) void * sodium_allocarray(size_t count, size_t size) { - size_t total_size; - if (count > (size_t) 0U && size >= (size_t) SIZE_MAX / count) { errno = ENOMEM; return NULL; } - total_size = count * size; - - return sodium_malloc(total_size); + return sodium_malloc(count * size); } #ifndef HAVE_ALIGNED_MALLOC