taglib-devel@kde.org
[Top] [All Lists]

Very big and ugly memory leaks

Subject: Very big and ugly memory leaks
From: Benoit Amiaux
Date: Sun, 03 Apr 2005 14:45:50 +0200
Hello, two evil gremlins were hidden inside taglib. I spent a lot of
time chasing them in my code until I realized that the following piece
of code was leaking:

TagLib::MPC:File foo("blah.mpc");
delete foo;

It looks like as if nobody tested ape tag reading in musepack files :(

Anyway, here is a patch for the two of them. IMO it's a big enough bug
to trigger a new minor taglib release as any file with APE tags or any
musepack file will leak a lots of memory.

--- apeitem.cpp 2004-11-06 18:27:20.000000000 +0100
+++ apeitem.cpp 2005-04-03 14:25:39.336529936 +0200
@@ -62,6 +62,11 @@
   d = new ItemPrivate(*item.d);
 }

+APE::Item::~Item()
+{
+  delete d;
+}
+
 Item &APE::Item::operator=(const Item &item)
 {
   delete d;

--- mpcfile.cpp 2004-09-09 00:42:29.000000000 +0200
+++ mpcfile.cpp 2005-04-03 14:25:16.253039160 +0200
@@ -53,8 +53,9 @@

   ~FilePrivate()
   {
-    delete ID3v1Tag;
+    delete tag;
     delete properties;
+    delete ID3v2Header;
   }

   APE::Tag *APETag;



_______________________________________________
taglib-devel mailing list
taglib-devel@xxxxxxx
https://mail.kde.org/mailman/listinfo/taglib-devel

<Prev in Thread] Current Thread [Next in Thread>