Version: svn 633141 (using KDE Devel) Installed from: Compiled sources I ran valgrind on taglib in subversion. There are 2 importants leaks plus 2 less important leaks. The importants leaks are: - failure to delete the APETag in mpegfile. - failure to delete the private object of UniqueFileIdentifierFrame. There are less important leaks related to not freeing the factory objects used by taglib.
Created attachment 19688 [details] Memory leaks fix Trivial patch.
In libtag_c (1.4.0) I'm also getting the following alloc / free mismatch ==18834== 1688 errors in context 19 of 19: ==18834== Thread 6: ==18834== Mismatched free() / delete / delete [] ==18834== at 0x4020937: operator delete[](void*) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so) ==18834== by 0x48D9CDE: taglib_tag_free_strings (in /usr/lib/libtag_c.so.0.0.0) coming from: ==18834== at 0x4021384: malloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so) ==18834== by 0x4A5C01F: strdup (in /lib/libc-2.5.so) ==18834== by 0x48D9B69: taglib_tag_artist (in /usr/lib/libtag_c.so.0.0.0) Almost looks like strings allocated with strdup are getting freeed by delete []
The C bindings issue has already been fixed in SVN.
SVN commit 634161 by wheeler: Delete d-pointer. CCBUG:141682 M +5 -0 uniquefileidentifierframe.cpp M +5 -0 uniquefileidentifierframe.h --- trunk/kdesupport/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.cpp #634160:634161 @@ -52,6 +52,11 @@ d->identifier = id; } +UniqueFileIdentifierFrame::~UniqueFileIdentifierFrame() +{ + delete d; +} + String UniqueFileIdentifierFrame::owner() const { return d->owner; --- trunk/kdesupport/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h #634160:634161 @@ -52,6 +52,11 @@ */ UniqueFileIdentifierFrame(const String &owner, const ByteVector &id); + /*! + * Destroys the frame. + */ + ~UniqueFileIdentifierFrame(); + /*! * Returns the owner for the frame; essentially this is the key for * determining which identification scheme this key belongs to. This
SVN commit 648984 by wheeler: Delete APE tag. BUG:141682 M +1 -0 mpegfile.cpp --- trunk/kdesupport/taglib/taglib/mpeg/mpegfile.cpp #648983:648984 @@ -188,6 +188,7 @@ ~FilePrivate() { delete ID3v2Tag; delete ID3v1Tag; + delete APETag; delete tag; delete properties; }