Ver código fonte

* apt-pkg/algorithms.cc:
- fix memory leak of Flags in pkgSimulate by a proper destructor

Marius Vollmer 14 anos atrás
pai
commit
b270388bef
3 arquivos alterados com 11 adições e 0 exclusões
  1. 6 0
      apt-pkg/algorithms.cc
  2. 1 0
      apt-pkg/algorithms.h
  3. 4 0
      debian/changelog

+ 6 - 0
apt-pkg/algorithms.cc

@@ -58,6 +58,12 @@ pkgSimulate::pkgSimulate(pkgDepCache *Cache) : pkgPackageManager(Cache),
       FileNames[I] = Jnk;
 }
 									/*}}}*/
+// Simulate::~Simulate - Destructor					/*{{{*/
+pkgSimulate::~pkgSimulate()
+{
+   delete[] Flags;
+}
+									/*}}}*/
 // Simulate::Describe - Describe a package				/*{{{*/
 // ---------------------------------------------------------------------
 /* Parameter Current == true displays the current package version,

+ 1 - 0
apt-pkg/algorithms.h

@@ -78,6 +78,7 @@ private:
    public:
 
    pkgSimulate(pkgDepCache *Cache);
+   ~pkgSimulate();
 };
 									/*}}}*/
 class pkgProblemResolver						/*{{{*/

+ 4 - 0
debian/changelog

@@ -32,6 +32,10 @@ apt (0.9.4) UNRELEASED; urgency=low
     - generate an equal sign also for the first arch (Closes: #669142)
 
 
+  [ Marius Vollmer ]
+  * apt-pkg/algorithms.cc:
+    - fix memory leak of Flags in pkgSimulate by a proper destructor
+
  -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 11 May 2012 23:26:59 +0200
 
 apt (0.9.3) unstable; urgency=low