[vlc-devel] [PATCH] access/directory.c: Fix a case where a double closedir could occur
Jean-Baptiste Kempf
jb at videolan.org
Mon Jul 7 18:28:58 CEST 2014
Idem
Le 07/07/2014 08:50, Julien 'Lta' BALLET a écrit :
> From: Julien 'Lta' BALLET <contact at lta.io>
>
> ---
> modules/access/directory.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/modules/access/directory.c b/modules/access/directory.c
> index c10cd96..717bc7d 100644
> --- a/modules/access/directory.c
> +++ b/modules/access/directory.c
> @@ -237,7 +237,6 @@ static bool directory_push (access_sys_t *p_sys, DIR *handle, char *psz_uri)
> return true;
>
> error:
> - closedir (handle);
> free (p_dir);
> free (psz_uri);
>
> @@ -420,10 +419,12 @@ int DirRead (access_t *p_access, input_item_node_t *p_current_node)
> /* Handle directory flags and recursion if in EXPAND mode */
> if (i_res == ENTRY_DIR)
> {
> - if (p_sys->mode == MODE_EXPAND
> - && directory_push (p_sys, handle, psz_full_uri))
> + if (p_sys->mode == MODE_EXPAND)
> {
> + if (directory_push (p_sys, handle, psz_full_uri))
> p_current_node = p_new_node;
> + else
> + closedir (handle);
> }
> }
>
>
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list