Skip to content

Commit ef58c53

Browse files
cosmo0920edsiper
authored andcommitted
output_thread: Validate a magic for cleaning up correctly on macOS
This is because TLS of macOS's pthread may return garbage values on unset. Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent b67db02 commit ef58c53

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/flb_output_thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static void output_thread(void *data)
402402
}
403403

404404
sched_params = (struct flb_sched_timer_coro_cb_params *) FLB_TLS_GET(sched_timer_coro_cb_params);
405-
if (sched_params != NULL) {
405+
if (sched_params != NULL && sched_params->magic == FLB_SCHED_TLS_MAGIC) {
406406
flb_free(sched_params);
407407
FLB_TLS_SET(sched_timer_coro_cb_params, NULL);
408408
}

0 commit comments

Comments
 (0)