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 58c7dfb..9ee436c 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 */