From e3b402f40373365e169f30d276e467f708074ffc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 6 Jun 2013 18:17:14 +0200 Subject: fix double free (closes: #711045) --- apt-pkg/contrib/fileutl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index f18e17005..46661887a 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1424,8 +1424,11 @@ bool FileFd::Seek(unsigned long long To) return _error->Error("Reopen is only implemented for read-only files!"); } #ifdef HAVE_BZ2 - if (d->bz2 != NULL) - BZ2_bzclose(d->bz2); + if (d->bz2 != NULL) + { + BZ2_bzclose(d->bz2); + d->bz2 = NULL; + } #endif if (iFd != -1) close(iFd); -- cgit v1.2.3