Commit 3172fde5 authored by Rémi Duraffort's avatar Rémi Duraffort

xspf: simplify and use free instead of FREENULL (not needed here).

parent b18257a3
...@@ -186,7 +186,8 @@ static bool parse_playlist_node COMPLEX_INTERFACE ...@@ -186,7 +186,8 @@ static bool parse_playlist_node COMPLEX_INTERFACE
if( !psz_name || !psz_value ) if( !psz_name || !psz_value )
{ {
msg_Err( p_demux, "invalid xml stream @ <playlist>" ); msg_Err( p_demux, "invalid xml stream @ <playlist>" );
FREE_ATT(); free( psz_name );
free( psz_value );
return false; return false;
} }
/* attribute: version */ /* attribute: version */
...@@ -612,7 +613,6 @@ static bool set_item_info SIMPLE_INTERFACE ...@@ -612,7 +613,6 @@ static bool set_item_info SIMPLE_INTERFACE
if( !psz_name || !psz_value || !p_input ) if( !psz_name || !psz_value || !p_input )
return false; return false;
/* re-convert xml special characters inside psz_value */ /* re-convert xml special characters inside psz_value */
resolve_xml_special_chars( psz_value ); resolve_xml_special_chars( psz_value );
...@@ -882,19 +882,18 @@ static bool parse_extitem_node COMPLEX_INTERFACE ...@@ -882,19 +882,18 @@ static bool parse_extitem_node COMPLEX_INTERFACE
{ {
VLC_UNUSED(psz_element); VLC_UNUSED(psz_element);
input_item_t *p_new_input = NULL; input_item_t *p_new_input = NULL;
char *psz_name = NULL;
char *psz_value = NULL;
int i_tid = -1; int i_tid = -1;
/* read all extension item attributes */ /* read all extension item attributes */
while( xml_ReaderNextAttr( p_xml_reader ) == VLC_SUCCESS ) while( xml_ReaderNextAttr( p_xml_reader ) == VLC_SUCCESS )
{ {
psz_name = xml_ReaderName( p_xml_reader ); char *psz_name = xml_ReaderName( p_xml_reader );
psz_value = xml_ReaderValue( p_xml_reader ); char *psz_value = xml_ReaderValue( p_xml_reader );
if( !psz_name || !psz_value ) if( !psz_name || !psz_value )
{ {
msg_Err( p_demux, "invalid xml stream @ <vlc:item>" ); msg_Err( p_demux, "invalid xml stream @ <vlc:item>" );
FREE_ATT(); free( psz_name );
free( psz_value );
return false; return false;
} }
/* attribute: href */ /* attribute: href */
...@@ -906,7 +905,8 @@ static bool parse_extitem_node COMPLEX_INTERFACE ...@@ -906,7 +905,8 @@ static bool parse_extitem_node COMPLEX_INTERFACE
else else
msg_Warn( p_demux, "invalid <vlc:item> attribute:\"%s\"", psz_name); msg_Warn( p_demux, "invalid <vlc:item> attribute:\"%s\"", psz_name);
FREE_ATT(); free( psz_name );
free( psz_value );
} }
/* attribute href is mandatory */ /* attribute href is mandatory */
...@@ -943,13 +943,12 @@ static bool parse_extitem_node COMPLEX_INTERFACE ...@@ -943,13 +943,12 @@ static bool parse_extitem_node COMPLEX_INTERFACE
static bool skip_element COMPLEX_INTERFACE static bool skip_element COMPLEX_INTERFACE
{ {
VLC_UNUSED(p_demux); VLC_UNUSED(p_input_item); VLC_UNUSED(p_demux); VLC_UNUSED(p_input_item);
char *psz_endname;
while( xml_ReaderRead( p_xml_reader ) == 1 ) while( xml_ReaderRead( p_xml_reader ) == 1 )
{ {
if( xml_ReaderNodeType( p_xml_reader ) == XML_READER_ENDELEM ) if( xml_ReaderNodeType( p_xml_reader ) == XML_READER_ENDELEM )
{ {
psz_endname = xml_ReaderName( p_xml_reader ); char *psz_endname = xml_ReaderName( p_xml_reader );
if( !psz_endname ) if( !psz_endname )
return false; return false;
if( !strcmp( psz_element, psz_endname ) ) if( !strcmp( psz_element, psz_endname ) )
......
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