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

erik subversion at mplayerhq.hu
Sat Aug 13 19:28:48 CEST 2011


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);
   free(vts_ptt_srpt);
   return 0;
 }


More information about the DVDnav-discuss mailing list