[vlc-commits] Playlist: fx missing unlocks (cid #1047159 and #1047160)

Rémi Duraffort git at videolan.org
Sat Jul 13 15:31:26 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jul 13 09:56:38 2013 +0200| [93e537ee198bd60086eaa93016ef2301b97d4979] | committer: Jean-Baptiste Kempf

Playlist: fx missing unlocks (cid #1047159 and #1047160)

(cherry picked from commit 3369a0bfca7439a3c58dcc0dc957371faed1c5f1)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=93e537ee198bd60086eaa93016ef2301b97d4979
---

 src/playlist/item.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index e536ff5..e902063 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -459,7 +459,11 @@ int playlist_AddInput( playlist_t* p_playlist, input_item_t *p_input,
     PL_LOCK_IF( !b_locked );
 
     p_item = playlist_ItemNewFromInput( p_playlist, p_input );
-    if( p_item == NULL ) return VLC_ENOMEM;
+    if( p_item == NULL )
+    {
+        PL_UNLOCK_IF( !b_locked );
+        return VLC_ENOMEM;
+    }
     AddItem( p_playlist, p_item,
              b_playlist ? p_playlist->p_playing :
                           p_playlist->p_media_library , i_mode, i_pos );
@@ -496,11 +500,13 @@ playlist_item_t * playlist_NodeAddInput( playlist_t *p_playlist,
     PL_LOCK_IF( !b_locked );
 
     p_item = playlist_ItemNewFromInput( p_playlist, p_input );
-    if( p_item == NULL ) return NULL;
+    if( p_item == NULL )
+        goto end;
     AddItem( p_playlist, p_item, p_parent, i_mode, i_pos );
 
     GoAndPreparse( p_playlist, i_mode, p_item );
 
+end:
     PL_UNLOCK_IF( !b_locked );
 
     return p_item;



More information about the vlc-commits mailing list