From e7bed050bc518d453c6aa4a104dfc2a5c387449c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 12 Apr 2018 20:54:06 +0200 Subject: [PATCH] Fix memory leak --- libretro-common/file/retro_dirent.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index 6c9de40b0b..648739a93c 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -109,11 +109,11 @@ struct RDIR *retro_opendir(const char *name) struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir)); if (!rdir||!name) + { + if (rdir) + free(rdir); return NULL; - - /* Handle empty string as current dir */ - if (*name==0) - name="."; + } #if defined(_WIN32) (void)path_wide;