diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-03-26 17:25:04 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-03-26 17:25:04 +0100 |
commit | 7a511e5d959f59ec6062a84b3a1ae372ff4f8e86 (patch) | |
tree | f21b8a92a2f285b429ba409a50f60505c5f51be7 | |
parent | 1c56c17a3c5548a3bb86c0d7967c0f790c7c2cca (diff) |
* cmdline/apt-get.cc, apt-pkg/cdrom.cc:
- fix memory leaks in error conditions in DoSource()
-rw-r--r-- | apt-pkg/cdrom.cc | 3 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 6 | ||||
-rw-r--r-- | debian/changelog | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 96d4e9c91..783ffc430 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -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();) { diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ea236676b..0bc8fc571 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -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) diff --git a/debian/changelog b/debian/changelog index bf07b9f30..5f5a43098 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 |