Commit 9d65e771 authored by Rémi Duraffort's avatar Rémi Duraffort

Avoid potential segfault and fix potential memleak.

parent 387950f7
...@@ -54,7 +54,7 @@ demux_t *__demux_New( vlc_object_t *p_obj, ...@@ -54,7 +54,7 @@ demux_t *__demux_New( vlc_object_t *p_obj,
p_demux->psz_path = strdup( psz_path ); p_demux->psz_path = strdup( psz_path );
/* Take into account "demux" to be able to do :demux=dump */ /* Take into account "demux" to be able to do :demux=dump */
if( *p_demux->psz_demux == '\0' ) if( p_demux->psz_demux && *p_demux->psz_demux == '\0' )
{ {
free( p_demux->psz_demux ); free( p_demux->psz_demux );
p_demux->psz_demux = var_GetNonEmptyString( p_obj, "demux" ); p_demux->psz_demux = var_GetNonEmptyString( p_obj, "demux" );
...@@ -358,6 +358,7 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux, ...@@ -358,6 +358,7 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
VLC_THREAD_PRIORITY_INPUT, false ) ) VLC_THREAD_PRIORITY_INPUT, false ) )
{ {
vlc_object_release( s ); vlc_object_release( s );
free( p_sys->psz_name );
free( p_sys ); free( p_sys );
return NULL; return NULL;
} }
......
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