Commit 476ca18b authored by Matthias Keiser's avatar Matthias Keiser Committed by Jean-Baptiste Kempf

access/directory.c: Fix compilation error on OS X and don't leak.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 63550af5
......@@ -186,10 +186,16 @@ static int directory_open (directory *p_dir, char *psz_entry, DIR **handle)
}
#else
char *path;
if (asprintf (&path, "%s/%s", current->path, entry) == -1)
goto ENTRY_EACCESS;
if ((*handle = vlc_opendir (path)) == NULL)
goto ENTRY_ENOTDIR;
if (asprintf (&path, "%s/%s", p_dir->path, psz_entry) == -1)
return ENTRY_EACCESS;
*handle = vlc_opendir (path);
free(path);
if (*handle == NULL) {
return ENTRY_ENOTDIR;
}
#endif
return ENTRY_DIR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment