From c5d2415e6e5ea088a494ba2770dd0fa1207dd7c0 Mon Sep 17 00:00:00 2001 From: tpltnt <1172976+tpltnt@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:00:10 +0200 Subject: [PATCH] fixing tiny resource leak when reading /proc/cpuinfo on Linux --- examples/llama-bench/llama-bench.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/llama-bench/llama-bench.cpp b/examples/llama-bench/llama-bench.cpp index a04115c96..69fa7c1ee 100644 --- a/examples/llama-bench/llama-bench.cpp +++ b/examples/llama-bench/llama-bench.cpp @@ -96,6 +96,9 @@ static std::string get_cpu_info() { } } } + if (0 != fclose(f)) { + fprintf(stderr, "could not close reader of /proc/cpuinfo\n"); + } } #endif // TODO: other platforms