[MPlayer-dev-eng] [PATCH][BUG] Incorrect memleak fix code in input/input.c might cause incorrect free

Shachar Raindel shacharr at gmail.com
Mon Jul 26 17:59:42 CEST 2004


On Mon, 26 Jul 2004 11:31:35 +0200, Alexander Strasser <eclipse7 at gmx.net> wrote:
> Hi,
> 
> 
> On Mon, Jul 26, 2004 at 12:01:12PM +0300, Shachar Raindel wrote:
> >   I attach a patch to fix the memleak fix patch aplied lately. The
> > patch applied didn't handle the case in which the config_file starts
> > with a '/', in which it will try to free a global array, which will
> > cause BadThing[TM] to happen.
> right :(
> I have to learn to read the code more thoroughly next time.
> 
> Just a view things:
> >    if( mp_input_parse_config(file)) {
> > -    free(file); // release the buffer created by get_path()
> > +    //    free(file); // release the buffer created by get_path()
> >    }
> >    else {
> This doesn't look to nice, but maybe i'm blind again.
> I would suggest:
>     if( !mp_input_parse_config(file)) {
> 
> > +  free(tmpbufptr);
> Maybe the freeing comment should be appended here.
> 
>   Alex (beastd)
> 

I agree. The patch was written under time presure, and therefore I
hadn't had time to make it pretty. I should clean-up my tree at home
soon, and send some cleanup patches, so that I will not have so much
CVS merge problems....

   Cheers,
   Shachar




More information about the MPlayer-dev-eng mailing list