]> git.sesse.net Git - vlc/blobdiff - src/playlist/item.c
playlist/item.c: Properly release the input_item as pointed by funman.
[vlc] / 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 */