[MPlayer-dev-eng] Re: [PATCH] Avoid freeing of unallocated memory in tv.c

Vladimir Voroshilov voroshil at gmail.com
Sun Jan 7 21:01:11 CET 2007


2007/1/8, Nico Sabbi <nicola_sabbi at fastwebnet.it>:
> Vladimir Voroshilov wrote:
> > 2007/1/2, Vladimir Voroshilov <voroshil at gmail.com>:
> >
> >  int tv_uninit(tvi_handle_t *tvh)
> >  {
> > -    return(tvh->functions->uninit(tvh->priv));
> > +    if(!tvh) return 1;
> > +    if (!tvh->priv) return 1;
>
> if(!tvh || !tvh->priv) return 1;
> but I have some doubt about the code quality of this double check
I hope my version is more safe.
So kept as is. Objection?
> > +    int res=tvh->functions->uninit(tvh->priv);
>
> c++ -ism
Fixed.

If no other objections i've apply patch for a few hours later.

-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tv_avoid_uninit_free3.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070108/4a515c79/attachment.txt>


More information about the MPlayer-dev-eng mailing list