add is_init check to malloc_info
parent
9fb2791af2
commit
50e0f1334c
|
@ -1800,6 +1800,8 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
|
|||
|
||||
#if CONFIG_STATS
|
||||
fputs("<malloc version=\"hardened_malloc-1\">", fp);
|
||||
|
||||
if (is_init()) {
|
||||
for (unsigned arena = 0; arena < N_ARENA; arena++) {
|
||||
fprintf(fp, "<heap nr=\"%u\">", arena);
|
||||
|
||||
|
@ -1841,6 +1843,7 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
|
|||
fprintf(fp, "<heap nr=\"%u\">", N_ARENA);
|
||||
fprintf(fp, "<allocated_large>%zu</allocated_large>", region_allocated);
|
||||
fputs("</heap>", fp);
|
||||
}
|
||||
|
||||
fputs("</malloc>", fp);
|
||||
|
||||
|
|
Loading…
Reference in New Issue