From 1d83649441e9e9fdbb5ba83bffca11ac4ac7b83c Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Tue, 25 Jul 2023 10:44:40 +0900 Subject: [PATCH] bin: remove cleanup code from flb_signal_exit (#7735) - remove cleanup code from flb_signal_exit - release trace_props Signed-off-by: Takahiro Yamashita --- src/fluent-bit.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/fluent-bit.c b/src/fluent-bit.c index c44ccd1bdd7..774001f985a 100644 --- a/src/fluent-bit.c +++ b/src/fluent-bit.c @@ -524,8 +524,6 @@ static void flb_signal_exit(int signal) char s[] = "[engine] caught signal ("; time_t now; struct tm *cur; - flb_ctx_t *ctx = flb_context_get(); - struct flb_cf *cf_opts = flb_cf_context_get(); now = time(NULL); cur = localtime(&now); @@ -550,25 +548,6 @@ static void flb_signal_exit(int signal) flb_print_signal(SIGTERM); flb_print_signal(SIGSEGV); }; - - /* Signal handlers */ - /* SIGSEGV is not handled here to preserve stacktrace */ - switch (signal) { - case SIGINT: - case SIGTERM: -#ifndef FLB_SYSTEM_WINDOWS - case SIGQUIT: - case SIGHUP: -#endif - if (cf_opts != NULL) { - flb_cf_destroy(cf_opts); - } - flb_stop(ctx); - flb_destroy(ctx); - _exit(EXIT_SUCCESS); - default: - break; - } } static void flb_signal_handler(int signal) @@ -1359,6 +1338,10 @@ int flb_main(int argc, char **argv) if (trace_output) { flb_free(trace_output); } + if (trace_props != NULL) { + flb_kv_release(trace_props); + flb_free(trace_props); + } #endif flb_stop(ctx);