diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index 24699ec1acb6..3354f51bddd6 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -923,11 +923,11 @@ int retro_vfs_stat_impl(const char *path, int32_t *size) if (path_buf[len - 1] == '/') path_buf[len - 1] = '\0'; - free(path_buf); - if (stat(path_buf, &stat_buf) < 0) return 0; + free(path_buf); + if (size) *size = (int32_t)stat_buf.st_size;