dvdread: fix memory leak.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 9 Aug 2010 10:23:03 +0000 (12:23 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 9 Aug 2010 10:23:20 +0000 (12:23 +0200)
modules/access/dvdread.c

index 82b8194..6c81daa 100644 (file)
@@ -271,6 +271,11 @@ static void Close( vlc_object_t *p_this )
         }
     }
 
+    /* Free the array of titles */
+    for( int i = 0; i < p_sys->i_titles; i++ )
+        vlc_input_title_Delete( p_sys->titles[i] );
+    TAB_CLEAN( p_sys->i_title, p_sys->titles );
+
     /* Close libdvdread */
     if( p_sys->p_title ) DVDCloseFile( p_sys->p_title );
     if( p_sys->p_vts_file ) ifoClose( p_sys->p_vts_file );