]> git.saurik.com Git - apt.git/commitdiff
* cmdline/apt-get.cc, apt-pkg/cdrom.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 26 Mar 2010 16:25:04 +0000 (17:25 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 26 Mar 2010 16:25:04 +0000 (17:25 +0100)
 - fix memory leaks in error conditions in DoSource()

apt-pkg/cdrom.cc
cmdline/apt-get.cc
debian/changelog

index 96d4e9c91c2f95ef56a3a851e68a9dd7a1e51347..783ffc43069338c169a79654599378222409c970 100644 (file)
@@ -289,7 +289,8 @@ bool pkgCdrom::DropRepeats(vector<string> &List,const char *Name)
         List[J] = string();
       }
    }  
+   delete[] Inodes;
+
    // Wipe erased entries
    for (unsigned int I = 0; I < List.size();)
    {
index ea236676b819504703fa841c94fe5f08776b36ca..0bc8fc5716ed25f2a5017fd910492a2c8ba134c0 100644 (file)
@@ -2315,6 +2315,7 @@ bool DoSource(CommandLine &CmdL)
    {
       for (unsigned I = 0; I != J; I++)
         ioprintf(cout,_("Fetch source %s\n"),Dsc[I].Package.c_str());
+      delete[] Dsc;
       return true;
    }
    
@@ -2325,6 +2326,7 @@ bool DoSource(CommandLine &CmdL)
       for (; I != Fetcher.UriEnd(); I++)
         cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
               I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
+      delete[] Dsc;
       return true;
    }
    
@@ -2350,6 +2352,7 @@ bool DoSource(CommandLine &CmdL)
    if (_config->FindB("APT::Get::Download-only",false) == true)
    {
       c1out << _("Download complete and in download only mode") << endl;
+      delete[] Dsc;
       return true;
    }
 
@@ -2411,7 +2414,8 @@ bool DoSource(CommandLine &CmdL)
       
       _exit(0);
    }
-   
+   delete[] Dsc;
+
    // Wait for the subprocess
    int Status = 0;
    while (waitpid(Process,&Status,0) != Process)
index bf07b9f30e5f7649f8741f9491aa340deec73720..5f5a43098b21f11469275802b78c9f47c9d85a44 100644 (file)
@@ -4,6 +4,8 @@ apt (0.7.25.3ubuntu4) UNRELEASED; urgency=low
   * apt-pkg/deb/debversion.cc:
     - consider absent of debian revision equivalent to 0 (Closes: #573592)
       LP: #540228
+  * cmdline/apt-get.cc, apt-pkg/cdrom.cc:
+   - fix memory leaks in error conditions in DoSource()
   
  -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 26 Mar 2010 16:57:49 +0100