Commit 775254b8 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix potential memleak.

parent 2b0814ab
...@@ -149,7 +149,12 @@ static int Demux( demux_t *p_demux ) ...@@ -149,7 +149,12 @@ static int Demux( demux_t *p_demux )
{ {
char *psz_name = xml_ReaderName( p_xml_reader ); char *psz_name = xml_ReaderName( p_xml_reader );
char *psz_value = xml_ReaderValue( p_xml_reader ); char *psz_value = xml_ReaderValue( p_xml_reader );
if( !psz_name || !psz_value ) return -1; if( !psz_name || !psz_value )
{
free( psz_name );
free( psz_value );
return -1;
}
if( !strcmp( psz_name, "num_entries" ) ) if( !strcmp( psz_name, "num_entries" ) )
{ {
msg_Dbg( p_demux, "playlist has %d entries", atoi(psz_value) ); msg_Dbg( p_demux, "playlist has %d entries", atoi(psz_value) );
......
...@@ -168,7 +168,12 @@ static int Demux( demux_t *p_demux ) ...@@ -168,7 +168,12 @@ static int Demux( demux_t *p_demux )
{ {
char *psz_name = xml_ReaderName( p_xml_reader ); char *psz_name = xml_ReaderName( p_xml_reader );
char *psz_value = xml_ReaderValue( p_xml_reader ); char *psz_value = xml_ReaderValue( p_xml_reader );
if( !psz_name || !psz_value ) return -1; if( !psz_name || !psz_value )
{
free( psz_name );
free( psz_value );
return -1;
}
if( !strcmp( psz_elname, "enclosure" ) && if( !strcmp( psz_elname, "enclosure" ) &&
!strcmp( psz_name, "url" ) ) !strcmp( psz_name, "url" ) )
{ {
......
...@@ -163,7 +163,12 @@ bool XMLParser::parse() ...@@ -163,7 +163,12 @@ bool XMLParser::parse()
{ {
char *name = xml_ReaderName( m_pReader ); char *name = xml_ReaderName( m_pReader );
char *value = xml_ReaderValue( m_pReader ); char *value = xml_ReaderValue( m_pReader );
if( !name || !value ) return false; if( !name || !value )
{
free( name );
free( value );
return false;
}
attributes[name] = value; attributes[name] = value;
} }
......
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