From 5e8b2b74ab565ffb72e035ce89a7a991d4de3dcf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 3 Apr 2010 17:57:41 +0200 Subject: Initialize history_out always with NULL so apt will not segfault later in the event of a failure in OpenLog() (which will happen if called with Debug::NoLocking as user) --- apt-pkg/deb/dpkgpm.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c0efa7b59..14a4968f7 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -105,7 +105,7 @@ ionice(int PID) /* */ pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache) : pkgPackageManager(Cache), dpkgbuf_pos(0), - term_out(NULL), PackagesDone(0), PackagesTotal(0) + term_out(NULL), history_out(NULL), PackagesDone(0), PackagesTotal(0) { } /*}}}*/ @@ -651,6 +651,7 @@ bool pkgDPkgPM::CloseLog() fprintf(history_out, "End-Date: %s\n", timestr); fclose(history_out); } + history_out = NULL; return true; } -- cgit v1.2.3