[vlc-devel] [PATCH] access/directory.c: Fix compilation error on OS X and don't leak.

Julien 'Lta' BALLET elthariel at gmail.com
Tue Jun 24 19:53:39 CEST 2014


Hi,

Thanks for noticing !

Regards,
Lta


On Tue, Jun 24, 2014 at 7:31 PM, Matthias Keiser <matthias at tristan-inc.com>
wrote:

> ---
>  modules/access/directory.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/modules/access/directory.c b/modules/access/directory.c
> index ef2a6a3..f4c6107 100644
> --- a/modules/access/directory.c
> +++ b/modules/access/directory.c
> @@ -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;
> --
> 1.8.5.2 (Apple Git-48)
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140624/89364e13/attachment.html>


More information about the vlc-devel mailing list