From ea59ebf4d3c2a5749e170cc45c294e04129e5b49 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Thu, 12 Nov 2015 14:59:29 +0300 Subject: [PATCH] Reuse previously computed value --- src/zone.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/zone.c b/src/zone.c index 12e1734a..6859b3fe 100644 --- a/src/zone.c +++ b/src/zone.c @@ -121,9 +121,11 @@ zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size) static void zone_free_definite_size(malloc_zone_t *zone, void *ptr, size_t size) { + size_t alloc_size; - if (ivsalloc(ptr, config_prof) != 0) { - assert(ivsalloc(ptr, config_prof) == size); + alloc_size = ivsalloc(ptr, config_prof); + if (alloc_size != 0) { + assert(alloc_size == size); je_free(ptr); return; }