Commit aed6c00e authored by Jean-Paul Saman's avatar Jean-Paul Saman

check malloc return value.

parent 77f30734
......@@ -125,10 +125,9 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
libvlc_media_list_t * p_mlist;
p_mlist = malloc(sizeof(libvlc_media_list_t));
if( !p_mlist )
return NULL;
p_mlist->p_libvlc_instance = p_inst;
p_mlist->p_event_manager = libvlc_event_manager_new( p_mlist, p_inst, p_e );
......@@ -153,7 +152,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
}
vlc_mutex_init( &p_mlist->object_lock );
vlc_array_init( &p_mlist->items );
p_mlist->i_refcount = 1;
p_mlist->p_md = NULL;
......@@ -405,7 +404,7 @@ void _libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist,
libvlc_exception_raise( p_e, "Index out of bounds exception");
return;
}
p_md = vlc_array_item_at_index( &p_mlist->items, index );
notify_item_deletion( p_mlist, p_md, index, EventWillHappen );
......
......@@ -261,6 +261,9 @@ libvlc_media_list_player_new( libvlc_instance_t * p_instance,
(void)p_e;
libvlc_media_list_player_t * p_mlp;
p_mlp = malloc(sizeof(libvlc_media_list_player_t));
if( !p_mlp )
return NULL;
p_mlp->current_playing_item_path = NULL;
p_mlp->p_mi = NULL;
p_mlp->p_mlist = NULL;
......@@ -316,7 +319,7 @@ void libvlc_media_list_player_set_media_list(
libvlc_exception_t * p_e )
{
vlc_mutex_lock( &p_mlp->object_lock );
if( libvlc_media_list_player_is_playing( p_mlp, p_e ) )
{
libvlc_media_player_stop( p_mlp->p_mi, p_e );
......
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