From 333e0e57888b85df95e319a41a07ee5381b2b117 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Dec 2024 00:52:17 -0500 Subject: Fix memory leak Also removes the last MAX_PATH buffer limit. --- src/win32/filesystem_win32.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/win32/filesystem_win32.c b/src/win32/filesystem_win32.c index 235ee0f..21bb94e 100644 --- a/src/win32/filesystem_win32.c +++ b/src/win32/filesystem_win32.c @@ -8,7 +8,6 @@ #include "win32_util.h" #include -#include #include #include @@ -365,10 +364,10 @@ zix_file_type(const char* const path) } // Resolve symlink to find the canonical type - char buf[MAX_PATH]; - ZixBumpAllocator allocator = zix_bump_allocator(sizeof(buf), buf); - char* const canonical = zix_canonical_path(&allocator.base, path); - return zix_symlink_type(canonical); + char* const canonical = zix_canonical_path(NULL, path); + const ZixFileType real_type = zix_symlink_type(canonical); + zix_free(NULL, canonical); + return real_type; } ZixFileType -- cgit v1.2.1