diff --git a/src/flb_log.c b/src/flb_log.c index 89c4715f12f..f9c7bfbc15d 100644 --- a/src/flb_log.c +++ b/src/flb_log.c @@ -692,6 +692,7 @@ int flb_log_destroy(struct flb_log *log, struct flb_config *config) flb_pipe_destroy(log->ch_mng); if (log->worker->log_cache) { flb_log_cache_destroy(log->worker->log_cache); + log->worker->log_cache = NULL; } flb_log_worker_destroy(log->worker); flb_free(log->worker); diff --git a/src/flb_worker.c b/src/flb_worker.c index 43bdad7b3cf..87bc006433d 100644 --- a/src/flb_worker.c +++ b/src/flb_worker.c @@ -142,6 +142,10 @@ void flb_worker_destroy(struct flb_worker *worker) return; } + if (worker->log_cache) { + flb_log_cache_destroy(worker->log_cache); + worker->log_cache = NULL; + } flb_log_worker_destroy(worker); mk_list_del(&worker->_head);