flac: Fix fd leak on bad FLAC files.

Some types of bad FLAC files error out early in the metadata parsing phase,
and we weren't properly deleting the iterator if it errored out at that
point.
This commit is contained in:
Justin Maggard 2015-09-10 11:58:16 -07:00
parent e4dab2455b
commit 0da13b33f0

View File

@ -37,8 +37,9 @@ _get_flctags(char *filename, struct song_metadata *psong)
if(!FLAC__metadata_simple_iterator_init(iterator, filename, true, true))
{
DPRINTF(E_ERROR, L_SCANNER, "Cannot extract tag from %s\n", filename);
return -1;
DPRINTF(E_ERROR, L_SCANNER, "Cannot extract tag from %s [%s]\n", filename,
FLAC__Metadata_SimpleIteratorStatusString[FLAC__metadata_simple_iterator_status(iterator)]);
goto _exit;
}
do {