[MPlayer-dev-eng] PATCH: processing "file:///" URL

Aurelien Jacobs aurel at gnuage.org
Fri Apr 15 17:09:09 CEST 2005


On Fri, 15 Apr 2005 00:04:58 +0400
Eugene Crosser <crosser at average.org> wrote:

> Ismail Donmez wrote:
> > On Thursday 14 April 2005 19:45, Eugene Crosser wrote:
> >
> >>+       if (strcmp(url->protocol, "file")==0){
> >>+               char *unescfilename = strdup(url->file);
> >>+               url_unescape_string(unescfilename,url->file);
> >>+               return open_stream_full(unescfilename,STREAM_READ,
> >>+                                              
> >options,file_format); >+       }
> >
> >
> > You don't free unescfilename anywhere so this code leaks.
> 
> That's right.  But it happens only once per run, so this should not be
> a problem.

Wrong. It's possible to load as much files as you want at runtime using
the 'loadfile' slave command.

> Besides that, as far as I could tell, other existing code
> that deals with URLs have similar leaks.

I don't think so, but if that's true, this should be fixed too.
Moreover, other URLs code at least do
  url_free(url);
  url = NULL;
Your code also need that.

> I can redo the patch if you people think it is really necessary.

That would be welcomed.

Aurel




More information about the MPlayer-dev-eng mailing list