- kill some huge memory leaks from dependency handling
authorPanu Matilainen <pmatilai@turre.koti.laiskiainen.org>
Thu, 1 Mar 2007 20:51:20 +0000 (22:51 +0200)
committerPanu Matilainen <pmatilai@turre.koti.laiskiainen.org>
Thu, 1 Mar 2007 20:51:20 +0000 (22:51 +0200)
apt-pkg/rpm/rpmlistparser.cc

index 0901b22..8e23d5f 100644 (file)
@@ -267,6 +267,7 @@ unsigned short rpmListParser::VersionHash()
       vector<Dependency*>::iterator I = Deps.begin();
       for (; I != DepEnd; I++) { 
         Result = AddCRC16(Result, (*I)->Name.c_str(), (*I)->Name.length());
+        delete (*I);
       }
    }
    return Result;
@@ -309,6 +310,7 @@ bool rpmListParser::ParseDepends(pkgCache::VerIterator Ver,
                    (*I)->Op,(*I)->Type) == false) {
         return false;
       }
+      delete (*I);
    }
    return true;
 
@@ -359,6 +361,7 @@ bool rpmListParser::ParseProvides(pkgCache::VerIterator Ver)
       if (NewProvides(Ver,(*I)->Name,(*I)->Version) == false) {
         return false;
       }
+      delete (*I);
    }
    return true;