From ada6361dece4265823478e0019a8c196e9285a26 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 29 Jul 2019 15:50:53 +0000 Subject: [PATCH] Use ROUND_TO_ALIGN in scratch_create --- src/scratch_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scratch_impl.h b/src/scratch_impl.h index f53de48bea38d..b205620224b6b 100644 --- a/src/scratch_impl.h +++ b/src/scratch_impl.h @@ -11,7 +11,7 @@ #include "scratch.h" static secp256k1_scratch* secp256k1_scratch_create(const secp256k1_callback* error_callback, size_t size) { - const size_t base_alloc = ((sizeof(secp256k1_scratch) + ALIGNMENT - 1) / ALIGNMENT) * ALIGNMENT; + const size_t base_alloc = ROUND_TO_ALIGN(sizeof(secp256k1_scratch)); void *alloc = checked_malloc(error_callback, base_alloc + size); secp256k1_scratch* ret = (secp256k1_scratch *)alloc; if (ret != NULL) {