summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/mmap.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-03-10 15:45:47 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-03-10 15:45:47 +0100
commit67da93c38eb3904b36537e025e2f63f77d830e20 (patch)
tree8ff57ccafb2f471fc97f97bfe8f0da11ca1eb7b1 /apt-pkg/contrib/mmap.cc
parentc9952021ba65db0581f6053cd6d6e8bf7d563e8f (diff)
parenta75b8cfeb6d7e2468b19534d5b5872c3885f0e1c (diff)
merged from debian-sid
Diffstat (limited to 'apt-pkg/contrib/mmap.cc')
-rw-r--r--apt-pkg/contrib/mmap.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index 69fb61fca..9945b1606 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -106,7 +106,7 @@ bool MMap::Map(FileFd &Fd)
/* */
bool MMap::Close(bool DoSync)
{
- if ((Flags & UnMapped) == UnMapped || Base == 0 || iSize == 0)
+ if ((Flags & UnMapped) == UnMapped || validData() == false || iSize == 0)
return true;
if (DoSync == true)
@@ -266,6 +266,8 @@ DynamicMMap::~DynamicMMap()
{
if (Fd == 0)
{
+ if (validData() == false)
+ return;
#ifdef _POSIX_MAPPED_FILES
munmap(Base, WorkSpace);
#else