Commit 25070505 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix memleak (the memory allocated by var_Control(VLC_VAR_GETCHOICES) must be

deallocated).
parent 2f484595
......@@ -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;
}
/*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment