From 1a1970342bf2097c571d72f2e947f037f6410c4f Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Fri, 16 Aug 2024 07:45:03 +0900 Subject: [PATCH] out_chronicle: fix a resource leak on exception (CID 508008) (#9234) Signed-off-by: Hiroshi Hatake --- plugins/out_chronicle/chronicle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/out_chronicle/chronicle.c b/plugins/out_chronicle/chronicle.c index c0cfc3e5a67..a8fab08eacd 100644 --- a/plugins/out_chronicle/chronicle.c +++ b/plugins/out_chronicle/chronicle.c @@ -877,6 +877,8 @@ static void cb_chronicle_flush(struct flb_event_chunk *event_chunk, flb_plg_error(ctx->ins, "Log event decoder initialization error : %d", ret); + /* Cleanup token and conn */ + flb_sds_destroy(token); flb_upstream_conn_release(u_conn); FLB_OUTPUT_RETURN(FLB_RETRY); }