[vlc-devel] commit: Fix memleak (CID 213) ( Rémi Duraffort )
Rémi Duraffort
ivoire at via.ecp.fr
Wed Oct 1 21:25:00 CEST 2008
> > /* Line is not recognized */
> > - else continue;
> > - free( psz_text );
> > + else
> > + {
> > + free( psz_text );
> > + continue;
> > + }
> > }
>
> Does not look very logical a change to me.
Yes but that's the correct fix because we have something like:
while()
{
psz = malloc();
if(...)
break;
else
continue;
}
So the free might be done before any new malloc (or we have a malloc)
Over solution is to init psz to null and to free just before the
malloc... (I don't car to be honest)
--
ivoire | Rémi Duraffort
More information about the vlc-devel
mailing list