From f932a48910034fefb21e88b1afdfd241abd9e459 Mon Sep 17 00:00:00 2001 From: TapTap Date: Tue, 21 Jul 2026 14:19:54 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20address=20review=20findings=20=E2=80=94?= =?UTF-8?q?=20test=5Fscanner=20cleanup,=20basename=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/server.c | 2 ++ tests/test_scanner.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/server.c b/src/server/server.c index d20d3a8..9df4e92 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -23,6 +23,8 @@ static bool is_excluded(const char* path, const Config* config) { char* path_dup = str_dup(path); if (!path_dup) return false; + /* basename(3) may return a pointer into path_dup or a static buffer; + * either way we free path_dup, not fname. */ char* fname = basename(path_dup); // Check exclude patterns diff --git a/tests/test_scanner.c b/tests/test_scanner.c index 7ec4a9e..4c6048c 100644 --- a/tests/test_scanner.c +++ b/tests/test_scanner.c @@ -248,8 +248,6 @@ static void test_scanner_max_size() { const char* dir = "test_scan_max"; const char* small = "test_scan_max/small.txt"; const char* large = "test_scan_max/large.txt"; - create_test_file(small, "tiny"); - create_test_file(large, "this_content_is_longer_than_ten_chars"); mkdir(dir, 0755); create_test_file(small, "tiny");