subtitle-demux: fix memory leaks (fixes #11908)
authorHannes Domani <ssbssa@yahoo.de>
Tue, 9 Sep 2014 00:17:03 +0000 (02:17 +0200)
committerTristan Matthews <le.businessman@gmail.com>
Wed, 10 Sep 2014 15:39:27 +0000 (11:39 -0400)
Signed-off-by: Tristan Matthews <le.businessman@gmail.com>
modules/demux/subtitle.c

index 67c267a..ad9b38e 100644 (file)
@@ -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;
     }
 }