Fixes:
Panic: stats_register() called after stats_alloc_size() was already called - this will break existing allocations
This could have happened with doveadm HTTP API when using multiple commands
in same HTTP connection.
array_delete(&stats_items, idx, 1);
i_free(item);
- if (array_count(&stats_items) == 0)
+ if (array_count(&stats_items) == 0) {
array_free(&stats_items);
+ /* all stats should have been freed by now. allow
+ re-registering and using stats. */
+ stats_allocated = FALSE;
+ }
}
struct stats *stats_alloc(pool_t pool)