Commit 4083a750 authored by Hannes Domani's avatar Hannes Domani Committed by Tristan Matthews

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

Signed-off-by: default avatarTristan Matthews <le.businessman@gmail.com>
(cherry picked from commit d47e80b68fe5331dc02e535cf9e5b3e3a52dfca5)
parent 4335aecf
...@@ -584,6 +584,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -584,6 +584,7 @@ static void Close( vlc_object_t *p_this )
for( i = 0; i < p_sys->i_subtitles; i++ ) for( i = 0; i < p_sys->i_subtitles; i++ )
free( p_sys->subtitle[i].psz_text ); free( p_sys->subtitle[i].psz_text );
free( p_sys->subtitle ); free( p_sys->subtitle );
free( p_sys->psz_header );
free( p_sys ); free( p_sys );
} }
...@@ -1158,6 +1159,7 @@ static int ParseSSA( demux_t *p_demux, subtitle_t *p_subtitle, ...@@ -1158,6 +1159,7 @@ static int ParseSSA( demux_t *p_demux, subtitle_t *p_subtitle,
if( asprintf( &psz_header, "%s%s\n", if( asprintf( &psz_header, "%s%s\n",
p_sys->psz_header ? p_sys->psz_header : "", s ) == -1 ) p_sys->psz_header ? p_sys->psz_header : "", s ) == -1 )
return VLC_ENOMEM; return VLC_ENOMEM;
free( p_sys->psz_header );
p_sys->psz_header = psz_header; p_sys->psz_header = psz_header;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment