Commit c9c13a50 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

shoutcast: fix NULL deref on error

(cherry picked from commit ad22a4a41fa28a2e6bb90f9ec4d72b6c10e58926)
parent 1952b89f
...@@ -314,11 +314,18 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader, ...@@ -314,11 +314,18 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
} }
/* Create the item */ /* Create the item */
input_item_t *p_input; input_item_t *p_input = NULL;
if( likely(psz_mrl != NULL) )
{
resolve_xml_special_chars( psz_mrl ); resolve_xml_special_chars( psz_mrl );
p_input = input_item_New( psz_mrl, psz_name ); p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl ); free( psz_mrl );
}
if( likely(p_input != NULL) )
{
input_item_CopyOptions( p_input_node->p_item, p_input );
#define SADD_INFO( type, field ) \ #define SADD_INFO( type, field ) \
if( field ) \ if( field ) \
...@@ -336,6 +343,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader, ...@@ -336,6 +343,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
input_item_SetRating( p_input, psz_rt ); input_item_SetRating( p_input, psz_rt );
input_item_node_AppendItem( p_input_node, p_input ); input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
}
FREENULL( psz_base ); FREENULL( psz_base );
FREENULL( psz_name ); FREENULL( psz_name );
FREENULL( psz_mt ); FREENULL( psz_mt );
......
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