From: RĂ©mi Duraffort Date: Wed, 20 May 2009 08:32:22 +0000 (+0200) Subject: Fix memleak (the memory allocated by var_Control(VLC_VAR_GETCHOICES) must be X-Git-Tag: 1.1.0-ff~5867^2~9 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=25070505add5986cc392ebdd826240fd62929b59;p=vlc Fix memleak (the memory allocated by var_Control(VLC_VAR_GETCHOICES) must be deallocated). --- diff --git a/src/control/audio.c b/src/control/audio.c index e1575ce790..e7a912fc26 100644 --- a/src/control/audio.c +++ b/src/control/audio.c @@ -391,13 +391,17 @@ int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi, { input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e ); vlc_value_t val_list; + int i_track_count; if( !p_input_thread ) return -1; var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL ); + i_track_count = val_list.p_list->i_count; + var_Change( p_input_thread, "audio-es", VLC_VAR_FREELIST, &val_list, NULL ); + vlc_object_release( p_input_thread ); - return val_list.p_list->i_count; + return i_track_count; } /*****************************************************************************