@@ -176,8 +176,12 @@ std::string AlbumArtProvider::get_image(const std::string &artist, const std::st
176176 fread(buf, 1, s, f);
177177 fclose(f);
178178
179− // Fixme, leaks buf if throws.
180− cache.add_art(info.artist, info.album, buf, s);
179+ try {
180+ cache.add_art(info.artist, info.album, buf, s);
181+ } catch(...) {
182+ delete []buf;
183+ throw;
184+ }
181185 delete []buf;
182186 return cache.get_art_file(info.artist, info.album);
183187}