mirror of https://code.videolan.org/videolan/vlc
media_track: fix tracklist leak when no track found
When count is 0 the list is still allocated. Either we should not allocate one, we free it locally, or we pass it on as it. The latter is similar to the code from40c14fbee4
in libvlc_media_tracklist_from_es_array(). Introduced in057f3ef9e8
.
This commit is contained in:
parent
4bc4577b99
commit
656e5eb27a
|
@ -270,7 +270,7 @@ libvlc_media_tracklist_from_player( vlc_player_t *player,
|
|||
libvlc_media_tracklist_t *list = libvlc_media_tracklist_alloc( count );
|
||||
|
||||
if( count == 0 || list == NULL )
|
||||
return NULL;
|
||||
return list;
|
||||
|
||||
for( size_t i = 0; i < count; ++i )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue