changeset 322:fc94594033a8 src

fix various memleaks, part of ogle-1764
author nicodvb
date Sun, 30 Dec 2007 14:22:32 +0000
parents e9dd884a3054
children d132820611d3
files dvdread/ifo_read.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dvdread/ifo_read.c	Sun Dec 30 14:08:25 2007 +0000
+++ b/dvdread/ifo_read.c	Sun Dec 30 14:22:32 2007 +0000
@@ -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);
@@ -1643,7 +1644,7 @@
         ifoFree_PGC(pgcit->pgci_srp[j].pgc);
         free(pgcit->pgci_srp[j].pgc);
       }
-      return 0;
+      goto fail;
     }
     if(!ifoRead_PGC(ifofile, pgcit->pgci_srp[i].pgc, 
                     offset + pgcit->pgci_srp[i].pgc_start_byte)) {
@@ -1652,12 +1653,15 @@
         ifoFree_PGC(pgcit->pgci_srp[j].pgc);
         free(pgcit->pgci_srp[j].pgc);
       }
-      free(pgcit->pgci_srp);
-      return 0;
+      goto fail;
     }
   }
 
   return 1;
+fail:
+  free(pgcit->pgci_srp);
+  pgcit->pgci_srp = NULL;
+  return 0;
 }
 
 static void ifoFree_PGCIT_internal(pgcit_t *pgcit) {