diff options
author | waker <wakeroid@gmail.com> | 2011-02-26 13:55:03 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-02-26 13:55:03 +0100 |
commit | 6600aecca3c56a9557241565fca5efbea50013b2 (patch) | |
tree | ce8da29d406889655f5fcf44efd8224767b75fc5 | |
parent | 0e0ed61257122a391d00ff780c57fab1f22c37e9 (diff) |
fixed vorbis plugin filehandle leak when vorbisfile failed to parse stream
-rw-r--r-- | plugins/vorbis/vorbis.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c index 05f8ca7b..140c4d9a 100644 --- a/plugins/vorbis/vorbis.c +++ b/plugins/vorbis/vorbis.c @@ -272,8 +272,12 @@ cvorbis_free (DB_fileinfo_t *_info) { deadbeef->pl_item_unref (info->ptrack); } if (info->info.file) { - ov_clear (&info->vorbis_file); - //fclose (file); //-- ov_clear closes it + if (info->vorbis_file.datasource) { + ov_clear (&info->vorbis_file); + } + else { + deadbeef->fclose (info->info.file); + } } free (info); } |