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) ...@@ -186,10 +186,16 @@ static int directory_open (directory *p_dir, char *psz_entry, DIR **handle)
} }
#else #else
char *path; char *path;
if (asprintf (&path, "%s/%s", current->path, entry) == -1) if (asprintf (&path, "%s/%s", p_dir->path, psz_entry) == -1)
goto ENTRY_EACCESS; return ENTRY_EACCESS;
if ((*handle = vlc_opendir (path)) == NULL)
goto ENTRY_ENOTDIR; *handle = vlc_opendir (path);
free(path);
if (*handle == NULL) {
return ENTRY_ENOTDIR;
}
#endif #endif
return ENTRY_DIR; 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