diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 53f1cced3f..b412fd8d44 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -205,6 +205,10 @@ bool path_mkdir(const char *dir) /* Use heap. Real chance of stack * overflow if we recurse too hard. */ basedir = strdup(dir); + + if (!basedir) + return false; + path_parent_dir(basedir); if (!*basedir || !strcmp(basedir, dir))