[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230629013444.50350-1-huxiaoying@kylinos.cn>
Date: Thu, 29 Jun 2023 09:34:44 +0800
From: Hu Xiaoying <huxiaoying@...inos.cn>
To: linux-kernel@...r.kernel.org
Cc: ast@...nel.org, daniel@...earbox.net,
Hu Xiaoying <huxiaoying@...inos.cn>
Subject: [PATCH] samples/bpf: Fix outf leak in hbm's read_trace_pipe2
Fix outf being fopen'ed but then not subsequently fclose'd. In the affected
branch, outf is otherwise going out of scope.
---
samples/bpf/hbm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/samples/bpf/hbm.c b/samples/bpf/hbm.c
index bf66277115e2..e28370741d9b 100644
--- a/samples/bpf/hbm.c
+++ b/samples/bpf/hbm.c
@@ -105,6 +105,8 @@ static void read_trace_pipe2(void)
}
}
}
+
+ fclose(outf);
}
static void do_error(char *msg, bool errno_flag)
--
2.25.1
Powered by blists - more mailing lists