[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglib-devel
Subject:    Very big and ugly memory leaks
From:       benoit.amiaux () laposte ! net (Benoit Amiaux)
Date:       2005-04-03 15:30:47
Message-ID: 1112532350.6667.13.camel () localhost ! localdomain
[Download RAW message or body]

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;



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic