]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cache.cc
fix memory leaks reported by -fsanitize
[apt.git] / cmdline / apt-cache.cc
index c2f6dbd5c8fbd31eeb7149237a7d6a4935eda8fc..9c884433c8be4c19e7c96337d0c55eb21256becd 100644 (file)
@@ -1484,6 +1484,7 @@ static bool Search(CommandLine &CmdL)
    delete [] PatternMatch;
    for (unsigned I = 0; I != NumPatterns; I++)
       regfree(&Patterns[I]);
+   delete [] Patterns;
    if (ferror(stdout))
        return _error->Error("Write to stdout failed");
    return true;
@@ -1728,7 +1729,7 @@ static bool Policy(CommandLine &CmdL)
            cout << " *** " << V.VerStr();
         else
            cout << "     " << V.VerStr();
-        cout << " " << Plcy->GetPriority(Pkg) << endl;
+        cout << " " << Plcy->GetPriority(V) << endl;
         for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; ++VF)
         {
            // Locate the associated index files so we can derive a description