From 2223cc3e8b23bdefe5a794c275d0c22293417a3e Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Wed, 14 Aug 2024 23:38:09 +0900 Subject: [PATCH] in_exec_wasi: fix resource leak on exception (CID 508347) (#9208) Signed-off-by: Hiroshi Hatake --- plugins/in_exec_wasi/in_exec_wasi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/in_exec_wasi/in_exec_wasi.c b/plugins/in_exec_wasi/in_exec_wasi.c index ba0164c1610..4da6e85b26a 100644 --- a/plugins/in_exec_wasi/in_exec_wasi.c +++ b/plugins/in_exec_wasi/in_exec_wasi.c @@ -76,6 +76,7 @@ static int in_exec_wasi_collect(struct flb_input_instance *ins, if (ctx->wasm_conf == NULL) { flb_plg_error(ctx->ins, "wasm_conf cannot be NULL"); + fclose(stdoutp); return -1; } ctx->wasm_conf->stdoutfd = fileno(stdoutp);