diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index d8d6f78eff..ea0d1c51e4 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -1280,17 +1280,15 @@ void fill_pathname_home_dir(char *s, size_t len) bool is_path_accessible_using_standard_io(const char *path) { - bool result = true; #ifdef __WINRT__ - size_t path_sizeof = PATH_MAX_LENGTH * sizeof(char); - char *relative_path_abbrev = (char*)malloc(path_sizeof); - fill_pathname_abbreviate_special(relative_path_abbrev, path, path_sizeof); - - result = (strlen(relative_path_abbrev) >= 2 ) - && (relative_path_abbrev[0] == ':' || relative_path_abbrev[0] == '~') + char relative_path_abbrev[PATH_MAX_LENGTH]; + fill_pathname_abbreviate_special(relative_path_abbrev, + path, sizeof(relative_path_abbrev)); + return (strlen(relative_path_abbrev) >= 2 ) + && ( relative_path_abbrev[0] == ':' + || relative_path_abbrev[0] == '~') && PATH_CHAR_IS_SLASH(relative_path_abbrev[1]); - - free(relative_path_abbrev); +#else + return true; #endif - return result; }