We really don't need an intermediate variable here

This commit is contained in:
Frank Denis 2017-12-16 13:04:59 +01:00
parent 5bc564cac1
commit 8fed6e5b46

View File

@ -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