From 9fb2791af21b36f2ecea67ecb5d27d3a85c7b9d9 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 17 Sep 2020 16:00:03 -0400 Subject: [PATCH] add is_init check to h_mallinfo_arena_info --- h_malloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/h_malloc.c b/h_malloc.c index c7a9c85..240166f 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -1883,6 +1883,10 @@ EXPORT struct mallinfo h_mallinfo_arena_info(UNUSED size_t arena) { struct mallinfo info = {0}; #if CONFIG_STATS + if (!is_init()) { + return info; + } + if (arena < N_ARENA) { for (unsigned class = 0; class < N_SIZE_CLASSES; class++) { struct size_class *c = &ro.size_class_metadata[arena][class];