TagLib::ASF::Tag::addAttribute possible memory leakage?

Lukáš Lalinský lalinsky at gmail.com
Thu Oct 7 10:23:14 CEST 2010


On Thu, Oct 7, 2010 at 8:32 AM, Anthony Liu <quadamage at gmail.com> wrote:
> Hi to all.
> It appeals that TagLib::ASF::Tag::addAttribute has a memory leakage bug,
>
>> ASF::File f( filename, false );
>>
>> ASF::Tag *asfTag = f.tag();
>>
>> ASF::Attribute atb( ByteVector( 10000000, 0 ) );
>>
>> asfTag->addAttribute( "Test",  atb );
>>
>>         f.save();
>
> The above code will cause memory leakage, if you increase the size of the
> asf attribute, things get even worst.

Can you please be more specific? Valgrind on examples/tagreader
reports no real memory leaks when running on a WMA file. Everything in
ASF::Attribute is reference-counted, it will get deleted when the last
instance runs out of context.

Lukas


More information about the taglib-devel mailing list