[DVDnav-discuss] [PATCH] libdvdread: segfault and patch to fix it (again)

Frédéric Marchal fmarchal at perso.be
Tue Oct 19 14:28:17 CEST 2010


On Tuesday 19 October 2010, Rémi Duraffort wrote:
> Hello,
>
> > -    free(ptl_mait->countries[i].pf_ptl_mai);
> > +    if (ptl_mait->countries[i].pf_ptl_mai)
> > +      free(ptl_mait->countries[i].pf_ptl_mai);
>
> AFAIK free(NULL) is totally valid so this change is just a non-op.

Thanks for pointing it out. It wasn't safe when I started programming in C... 
I missed that 20 years old evolution :-).

Frederic


More information about the DVDnav-discuss mailing list