]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/algorithms.cc:
authorJonathan Thomas <echidnaman@gmail.com>
Sat, 10 Nov 2012 13:25:45 +0000 (14:25 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 10 Nov 2012 13:25:45 +0000 (14:25 +0100)
  - fix package-pointer array memory leak in ResolveByKeepInternal()

apt-pkg/algorithms.cc
debian/changelog

index b611df17286bfee5235470ec38efc3599a5e6737..8cd9d4c6eacc83f49e444911b395baa21bc4662d 100644 (file)
@@ -1419,12 +1419,18 @@ bool pkgProblemResolver::ResolveByKeepInternal()
         continue;
       
       // Restart again.
         continue;
       
       // Restart again.
-      if (K == LastStop)
-        return _error->Error("Internal Error, pkgProblemResolver::ResolveByKeep is looping on package %s.",I.FullName(false).c_str());
+      if (K == LastStop) {
+          // I is an iterator based off our temporary package list,
+          // so copy the name we need before deleting the temporary list
+          std::string const LoopingPackage = I.FullName(false);
+          delete[] PList;
+          return _error->Error("Internal Error, pkgProblemResolver::ResolveByKeep is looping on package %s.", LoopingPackage.c_str());
+      }
       LastStop = K;
       K = PList - 1;
       LastStop = K;
       K = PList - 1;
-   }   
+   }
 
 
+   delete[] PList;
    return true;
 }
                                                                        /*}}}*/
    return true;
 }
                                                                        /*}}}*/
index ddbc8de89e624e48cdbb72d0c9f0956d5ff9db87..e2b0d753ef54b40d3c2951325b8b717f229b6fad 100644 (file)
@@ -21,6 +21,10 @@ apt (0.9.7.7) UNRELEASED; urgency=low
     - ensure pkgProblemResolver calls MarkDelete without FromUser set
       so that it can't overrule holds and the protection flag
 
     - ensure pkgProblemResolver calls MarkDelete without FromUser set
       so that it can't overrule holds and the protection flag
 
+  [ Jonathan Thomas ]
+  * apt-pkg/algorithms.cc:
+    - fix package-pointer array memory leak in ResolveByKeepInternal()
+
  -- Jordi Mallach <jordi@debian.org>  Thu, 18 Oct 2012 23:30:46 +0200
 
 apt (0.9.7.6) unstable; urgency=low
  -- Jordi Mallach <jordi@debian.org>  Thu, 18 Oct 2012 23:30:46 +0200
 
 apt (0.9.7.6) unstable; urgency=low