[matroska] r822 - trunk/DvdMenuXtractor/libdvdread/dvdread

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-09-18 16:40:40 +0400 (Sat, 18 Sep 2004)
New Revision: 822

Modified:
   trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
   trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
Log:
fix memory leaks in libdvdread (!)

Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c	2004-09-18 12:39:36 UTC (rev 821)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c	2004-09-18 12:40:40 UTC (rev 822)
@@ -529,10 +529,12 @@
             sprintf( filename, "%s%s%s", path,
                      ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
                      ent->d_name );
+			closedir(dir);
             return 0;
         }
     }
 
+	closedir(dir);
     return -1;
 }
 

Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c	2004-09-18 12:39:36 UTC (rev 821)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c	2004-09-18 12:40:40 UTC (rev 822)
@@ -257,6 +257,7 @@
   ifoFree_FP_PGC(ifofile);
   ifoFree_PGCIT(ifofile);
   ifoFree_VTS_PTT_SRPT(ifofile);
+  ifoFree_VTS_TMAPT(ifofile);
 
   if(ifofile->vmgi_mat)
     free(ifofile->vmgi_mat);
@@ -1663,8 +1664,10 @@
 static void ifoFree_PGCIT_internal(pgcit_t *pgcit) {
   if(pgcit) {
     int i;
-    for(i = 0; i < pgcit->nr_of_pgci_srp; i++)
+	for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
       ifoFree_PGC(pgcit->pgci_srp[i].pgc);
+      free(pgcit->pgci_srp[i].pgc);
+	}
     free(pgcit->pgci_srp);
   }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.