From: Willy Tarreau Date: Wed, 27 Apr 2022 15:50:53 +0000 (+0200) Subject: CLEANUP: errors: also call deinit_errors_buffers() on deinit() X-Git-Tag: v2.6-dev8~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=032e700e8bd1cd947d1cb7028b0dda102419cbdd;p=thirdparty%2Fhaproxy.git CLEANUP: errors: also call deinit_errors_buffers() on deinit() Tim reported in issue #1676 that we don't release startup logs if we warn during startup and quit before creating threads (e.g. -c -f ...). Let's subscribe deinit_errors_buffers() to both thread's end and deinit. That's OK since it uses both per-thread and global variables, and is idempotent. --- diff --git a/src/errors.c b/src/errors.c index 993b6ae582..109ec0aaae 100644 --- a/src/errors.c +++ b/src/errors.c @@ -375,4 +375,6 @@ static void deinit_errors_buffers() ha_free(&usermsgs_ctx.str.area); } +/* errors might be used in threads and even before forking, thus 2 deinit */ REGISTER_PER_THREAD_FREE(deinit_errors_buffers); +REGISTER_POST_DEINIT(deinit_errors_buffers);