summaryrefslogtreecommitdiffstats
path: root/src/win32
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-12-11 09:49:13 -0500
committerDavid Robillard <d@drobilla.net>2024-12-11 10:06:33 -0500
commit09bfde1eb9b70cd32b8ca3c1cc9742d661277e3d (patch)
tree61c3764fac49ed8623cd56c821804cd00e5be374 /src/win32
parent158e199d0dbc54fe497a53b167c880a8c85a9017 (diff)
downloadzix-09bfde1eb9b70cd32b8ca3c1cc9742d661277e3d.tar.gz
zix-09bfde1eb9b70cd32b8ca3c1cc9742d661277e3d.tar.bz2
zix-09bfde1eb9b70cd32b8ca3c1cc9742d661277e3d.zip
Fix potential null dereferences
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/filesystem_win32.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/win32/filesystem_win32.c b/src/win32/filesystem_win32.c
index 21bb94e..24ba427 100644
--- a/src/win32/filesystem_win32.c
+++ b/src/win32/filesystem_win32.c
@@ -365,7 +365,9 @@ zix_file_type(const char* const path)
// Resolve symlink to find the canonical type
char* const canonical = zix_canonical_path(NULL, path);
- const ZixFileType real_type = zix_symlink_type(canonical);
+ const ZixFileType real_type =
+ canonical ? zix_symlink_type(canonical) : ZIX_FILE_TYPE_NONE;
+
zix_free(NULL, canonical);
return real_type;
}