[vlc-commits] WPL: fix leak and NULL dereference
Rémi Denis-Courmont
git at videolan.org
Mon Nov 17 18:03:26 CET 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 17 18:37:15 2014 +0200| [cd8e3a2be041f06f93e17bb6af76d6ed2c743a7d] | committer: Rémi Denis-Courmont
WPL: fix leak and NULL dereference
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd8e3a2be041f06f93e17bb6af76d6ed2c743a7d
---
modules/demux/playlist/wpl.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/modules/demux/playlist/wpl.c b/modules/demux/playlist/wpl.c
index 365488b..c2c209a 100644
--- a/modules/demux/playlist/wpl.c
+++ b/modules/demux/playlist/wpl.c
@@ -95,15 +95,19 @@ static int Demux( demux_t *p_demux )
psz_parse = strchr( psz_uri, '"' );
if( psz_parse != NULL )
{
- input_item_t *p_input;
-
*psz_parse = '\0';
resolve_xml_special_chars( psz_uri );
psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix );
- p_input = input_item_NewExt( psz_uri, psz_uri,
- 0, NULL, 0, -1 );
- input_item_node_AppendItem( p_subitems, p_input );
- vlc_gc_decref( p_input );
+ if( psz_uri != NULL )
+ {
+ input_item_t *p_input;
+
+ p_input = input_item_NewExt( psz_uri, psz_uri,
+ 0, NULL, 0, -1 );
+ input_item_node_AppendItem( p_subitems, p_input );
+ vlc_gc_decref( p_input );
+ free( psz_uri );
+ }
}
}
More information about the vlc-commits
mailing list