[vlc-devel] [vlc-commits] file: fix fd leak when opening a directory

Thomas Guillem thomas at gllm.fr
Tue Jun 16 14:09:27 CEST 2015



On Tue, Jun 16, 2015, at 13:25, Rémi Denis-Courmont wrote:
> Le 2015-06-16 14:18, git at videolan.org a écrit :
> > vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun 16
> > 13:17:36 2015 +0200| [b9704c0b3cb12dc43cbf368515a53f9d4e3a6f57] |
> > committer: Thomas Guillem
> >
> > file: fix fd leak when opening a directory
> >
> >> 
> >> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b9704c0b3cb12dc43cbf368515a53f9d4e3a6f57
> > ---
> >
> >  modules/access/file.c |    1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/modules/access/file.c b/modules/access/file.c
> > index 816fd32..04fc783 100644
> > --- a/modules/access/file.c
> > +++ b/modules/access/file.c
> > @@ -205,6 +205,7 @@ int FileOpen( vlc_object_t *p_this )
> >      if (S_ISDIR (st.st_mode))
> >      {
> >  #ifdef HAVE_FDOPENDIR
> > +        close(fd);
> >          return DirOpen (VLC_OBJECT(p_access));
> 
> This cannot be right: fdopendir() needs the descriptor. Either this 
> patch is wrong or some earlier one broke fdopendir().

Ah yes, this is wrong and a previous patch of mine broke fdopendir.
I have proposed a new patch.

> 
> >  #else
> >          msg_Dbg (p_access, "ignoring directory");
> >
> > _______________________________________________
> > vlc-commits mailing list
> > vlc-commits at videolan.org
> > https://mailman.videolan.org/listinfo/vlc-commits
> 
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list