Browse Source

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)
debian/1.8.y
David Kalnischkies 12 years ago
parent
commit
5e8b2b74ab
  1. 3
      apt-pkg/deb/dpkgpm.cc

3
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;
}

Loading…
Cancel
Save