summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-04-03 17:57:41 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-04-03 17:57:41 +0200
commit5e8b2b74ab565ffb72e035ce89a7a991d4de3dcf (patch)
treea1c70dc832b3b3e5dc2ad85cb250481ae8e1f968 /apt-pkg
parentc753eec1d192a56e7f4ba1b07ae766b740185a3f (diff)
downloadapt-5e8b2b74ab565ffb72e035ce89a7a991d4de3dcf.tar.gz
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)
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/dpkgpm.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index c0efa7b5..14a4968f 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;
}