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 675149b9b8
commit 77e7d88d89

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