Commit a9ec7097 authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Derk-Jan Hartman

Fix memleaks (CID 211)

(cherry picked from commit 6c79686b)
parent 9be86469
...@@ -1459,7 +1459,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) ...@@ -1459,7 +1459,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
const char *s = TextGetLine( txt ); const char *s = TextGetLine( txt );
if( !s ) if( !s )
{
free( psz_text );
return VLC_EGENERIC; return VLC_EGENERIC;
}
if( strstr( s, "FORMAT" ) ) if( strstr( s, "FORMAT" ) )
{ {
...@@ -1471,7 +1474,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) ...@@ -1471,7 +1474,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
psz_temp = malloc( strlen(s) ); psz_temp = malloc( strlen(s) );
if( !psz_temp ) if( !psz_temp )
{
free( psz_text );
return VLC_ENOMEM; return VLC_ENOMEM;
}
if( sscanf( s, "FORMAT=%[^\r\n]", psz_temp ) ) if( sscanf( s, "FORMAT=%[^\r\n]", psz_temp ) )
{ {
...@@ -1504,7 +1510,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) ...@@ -1504,7 +1510,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
const char *s = TextGetLine( txt ); const char *s = TextGetLine( txt );
if( !s ) if( !s )
{
free( psz_text );
return VLC_EGENERIC; return VLC_EGENERIC;
}
int i_len = strlen( s ); int i_len = strlen( s );
if( i_len == 0 ) if( i_len == 0 )
......
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