diff options
author | David Robillard <d@drobilla.net> | 2024-12-11 00:52:17 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-12-11 00:52:17 -0500 |
commit | 333e0e57888b85df95e319a41a07ee5381b2b117 (patch) | |
tree | ff44624cac827668149ab96b5a5a96707d4d9485 | |
parent | c3caeb9305dea922bfe3ed71e006e567bb25ecb2 (diff) | |
download | zix-333e0e57888b85df95e319a41a07ee5381b2b117.tar.gz zix-333e0e57888b85df95e319a41a07ee5381b2b117.tar.bz2 zix-333e0e57888b85df95e319a41a07ee5381b2b117.zip |
Fix memory leak
Also removes the last MAX_PATH buffer limit.
-rw-r--r-- | src/win32/filesystem_win32.c | 9 |
1 files 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 <zix/allocator.h> -#include <zix/bump_allocator.h> #include <zix/path.h> #include <zix/status.h> @@ -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 |