Skip to content

Commit 1d83649

Browse files
authored
bin: remove cleanup code from flb_signal_exit (#7735)
- remove cleanup code from flb_signal_exit - release trace_props Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent 659a4db commit 1d83649

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

src/fluent-bit.c

+4-21
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,6 @@ static void flb_signal_exit(int signal)
524524
char s[] = "[engine] caught signal (";
525525
time_t now;
526526
struct tm *cur;
527-
flb_ctx_t *ctx = flb_context_get();
528-
struct flb_cf *cf_opts = flb_cf_context_get();
529527

530528
now = time(NULL);
531529
cur = localtime(&now);
@@ -550,25 +548,6 @@ static void flb_signal_exit(int signal)
550548
flb_print_signal(SIGTERM);
551549
flb_print_signal(SIGSEGV);
552550
};
553-
554-
/* Signal handlers */
555-
/* SIGSEGV is not handled here to preserve stacktrace */
556-
switch (signal) {
557-
case SIGINT:
558-
case SIGTERM:
559-
#ifndef FLB_SYSTEM_WINDOWS
560-
case SIGQUIT:
561-
case SIGHUP:
562-
#endif
563-
if (cf_opts != NULL) {
564-
flb_cf_destroy(cf_opts);
565-
}
566-
flb_stop(ctx);
567-
flb_destroy(ctx);
568-
_exit(EXIT_SUCCESS);
569-
default:
570-
break;
571-
}
572551
}
573552

574553
static void flb_signal_handler(int signal)
@@ -1359,6 +1338,10 @@ int flb_main(int argc, char **argv)
13591338
if (trace_output) {
13601339
flb_free(trace_output);
13611340
}
1341+
if (trace_props != NULL) {
1342+
flb_kv_release(trace_props);
1343+
flb_free(trace_props);
1344+
}
13621345
#endif
13631346

13641347
flb_stop(ctx);

0 commit comments

Comments
 (0)