Summary: | Taglib memory leaks found with Valgrind | ||
---|---|---|---|
Product: | [Frameworks and Libraries] taglib | Reporter: | Xavier Duret <xaviour.maillists> |
Component: | general | Assignee: | Scott Wheeler <wheeler> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Memory leaks fix |
Description
Xavier Duret
2007-02-14 14:28:40 UTC
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; } |