The attached patch contains (untested) memory and fd leak fixes found by cppcheck.
I see some of these (at least the one for metadata_iterators.c) is already reported (#2946736)
Ville Skyttä
2011-11-11
Memory and fd leak fixes
Max Horn
2012-12-12
I verified that all fixes in this patch have been applied (sometimes in different form) to the flac source repository, see https://git.xiph.org/?p=flac.git -- so hopefully they will be part of the next release.