TagLib 1.7 Memory leak when saving Xiph comments in a FLAC file

Scott Wheeler wheeler at kde.org
Mon May 9 19:09:04 CEST 2011


On May 9, 2011, at 6:00 PM, David Troendle wrote:

> I am a newbie encountering a memory leak when saving comments in a FLAC file.
>  
> I have distilled the problem down to the following code snippet:
>  
>       TagLib::FLAC::File FLACFile(<any FLAC file name>);
>       TagLib::Ogg::XiphComment *FLACTags = FLACFile.xiphComment();
>       FLACTags->addField("ARTIST", "New Value");
>       FLACFile.save();
>  
> NOTE:  If the “FLACFile.save();” is omitted, only the one-time FrameFactory and stringHandler leaks occurs. (No problem there.)

I just committed a fix for this, see:

https://github.com/taglib/taglib/commit/efeccbf72614efaed1c7282f8c9ee02a0acf871f

(The leak was visible with valgrind as well and this cleared it up.)

Cheers,

-Scott


More information about the taglib-devel mailing list