[vlc-commits] subtitle-demux: fix memory leaks (fixes #11908)

Hannes Domani git at videolan.org
Wed Sep 10 17:41:54 CEST 2014


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Tue Sep  9 02:17:03 2014 +0200| [d47e80b68fe5331dc02e535cf9e5b3e3a52dfca5] | committer: Tristan Matthews

subtitle-demux: fix memory leaks (fixes #11908)

Signed-off-by: Tristan Matthews <le.businessman at gmail.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d47e80b68fe5331dc02e535cf9e5b3e3a52dfca5
---

 modules/demux/subtitle.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 67c267a..ad9b38e 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -585,6 +585,7 @@ static void Close( vlc_object_t *p_this )
     for( i = 0; i < p_sys->i_subtitles; i++ )
         free( p_sys->subtitle[i].psz_text );
     free( p_sys->subtitle );
+    free( p_sys->psz_header );
 
     free( p_sys );
 }
@@ -1158,6 +1159,7 @@ static int  ParseSSA( demux_t *p_demux, subtitle_t *p_subtitle,
         if( asprintf( &psz_header, "%s%s\n",
                        p_sys->psz_header ? p_sys->psz_header : "", s ) == -1 )
             return VLC_ENOMEM;
+        free( p_sys->psz_header );
         p_sys->psz_header = psz_header;
     }
 }



More information about the vlc-commits mailing list