From: Pierre d'Herbemont Date: Sat, 29 Dec 2007 14:25:14 +0000 (+0000) Subject: playlist/item.c: Properly release the input_item as pointed by funman. X-Git-Tag: 0.9.0-test0~3812 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=09715dbfbee76a6d293027cde19cd8c0b1d23a1c;p=vlc playlist/item.c: Properly release the input_item as pointed by funman. --- diff --git a/src/playlist/item.c b/src/playlist/item.c index 58c7dfbe51..9ee436c092 100644 --- a/src/playlist/item.c +++ b/src/playlist/item.c @@ -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 */