[DVDnav-discuss] r1233 - trunk/libdvdread/src/ifo_read.c

Frédéric Marchal fmarchal at perso.be
Thu Aug 18 17:09:06 CEST 2011


On Saturday 13 August 2011 19:28:48 erik wrote:
> Author: erik
> Date: Sat Aug 13 19:28:48 2011
> New Revision: 1233
> 
> Log:
> Make sure vts_ptt_srpt->title is freed
> 
> title was being leaked when the error path is hit in this function.
> 
> Modified:
>    trunk/libdvdread/src/ifo_read.c
> 
> Modified: trunk/libdvdread/src/ifo_read.c
> 
===========================================================================
> === --- trunk/libdvdread/src/ifo_read.c	Sat Aug 13 19:28:45 2011	(r1232)
> +++ trunk/libdvdread/src/ifo_read.c	Sat Aug 13 19:28:48 2011	(r1233) @@
> -1160,6 +1160,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
>    if(!vts_ptt_srpt)
>      return 0;
> 
> +  vts_ptt_srpt->title = NULL;
>    ifofile->vts_ptt_srpt = vts_ptt_srpt;
> 
>    if(!(DVDReadBytes(ifofile->file, vts_ptt_srpt, VTS_PTT_SRPT_SIZE))) {
> @@ -1257,6 +1258,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
>  fail:
>    free(data);
>    ifofile->vts_ptt_srpt = 0;
> +  free(vts_ptt_srpt->title);

I believe it should be:

if (vts_ptt_srpt) free(vts_ptt_srpt->title);

>    free(vts_ptt_srpt);
>    return 0;
>  }
> _______________________________________________
> DVDnav-discuss mailing list
> DVDnav-discuss at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss


More information about the DVDnav-discuss mailing list