]> git.sesse.net Git - vlc/commitdiff
playlist/item.c: Properly release the input_item as pointed by funman.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 29 Dec 2007 14:25:14 +0000 (14:25 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 29 Dec 2007 14:25:14 +0000 (14:25 +0000)
src/playlist/item.c

index 58c7dfbe5181e9a66b13a001579a04803e9a59d5..9ee436c092532405bccd27eca0d93eb98eeff579 100644 (file)
@@ -295,10 +295,11 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
 
     i_ret = playlist_AddInput( p_playlist, p_input, i_mode, i_pos, b_playlist,
                                b_locked );
+    int i_id = i_ret == VLC_SUCCESS ? p_input->i_id : -1
+
     vlc_gc_decref( p_input );
-    if( i_ret == VLC_SUCCESS )
-        return p_input->i_id;
-    return -1;
+
+    return i_id;
 }
 
 /** Add an input item to the playlist node */