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

Hannes Domani git at videolan.org
Wed Sep 10 18:07:52 CEST 2014


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

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

Signed-off-by: Tristan Matthews <le.businessman at gmail.com>
(cherry picked from commit d47e80b68fe5331dc02e535cf9e5b3e3a52dfca5)

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

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

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 29922cc..b20389c 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -584,6 +584,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