Commit 9b8589f8 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlc: Make sure we unlock on error code path.

parent 5d59d04c
...@@ -170,6 +170,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em, ...@@ -170,6 +170,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
array_listeners_cached = malloc(sizeof(libvlc_event_listener_t)*(i_cached_listeners)); array_listeners_cached = malloc(sizeof(libvlc_event_listener_t)*(i_cached_listeners));
if( !array_listeners_cached ) if( !array_listeners_cached )
{ {
vlc_mutex_unlock( &p_em->object_lock );
fprintf(stderr, "Can't alloc memory in libvlc_event_send" ); fprintf(stderr, "Can't alloc memory in libvlc_event_send" );
return; return;
} }
...@@ -188,6 +189,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em, ...@@ -188,6 +189,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
if( !listeners_group ) if( !listeners_group )
{ {
free( array_listeners_cached ); free( array_listeners_cached );
vlc_mutex_unlock( &p_em->object_lock );
return; return;
} }
......
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