Commit 7d7a42b8 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix memleak (CID 67) and don't use 0 instead of NULL

parent f2157f9d
...@@ -98,7 +98,7 @@ static int Demux( demux_t *p_demux ) ...@@ -98,7 +98,7 @@ static int Demux( demux_t *p_demux )
psz_elname = stream_ReadLine( p_demux->s ); psz_elname = stream_ReadLine( p_demux->s );
free( psz_elname ); free( psz_elname );
psz_elname = 0; psz_elname = NULL;
p_xml_reader = xml_ReaderCreate( p_xml, p_demux->s ); p_xml_reader = xml_ReaderCreate( p_xml, p_demux->s );
if( !p_xml_reader ) return -1; if( !p_xml_reader ) return -1;
...@@ -142,7 +142,7 @@ static int Demux( demux_t *p_demux ) ...@@ -142,7 +142,7 @@ static int Demux( demux_t *p_demux )
free( psz_elname ); free( psz_elname );
return -1; return -1;
} }
free( psz_elname ); psz_elname = 0; free( psz_elname ); psz_elname = NULL;
// Read the attributes // Read the attributes
while( xml_ReaderNextAttr( p_xml_reader ) == VLC_SUCCESS ) while( xml_ReaderNextAttr( p_xml_reader ) == VLC_SUCCESS )
...@@ -294,6 +294,8 @@ static int Demux( demux_t *p_demux ) ...@@ -294,6 +294,8 @@ static int Demux( demux_t *p_demux )
msg_Warn( p_demux, "error while parsing data" ); msg_Warn( p_demux, "error while parsing data" );
} }
free( psz_elname );
HANDLE_PLAY_AND_RELEASE; HANDLE_PLAY_AND_RELEASE;
return 0; /* Needed for correct operation of go back */ return 0; /* Needed for correct operation of go back */
} }
......
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