From 3d8232bf97ce11818fb07813a71136484ea1a44a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 18 Jun 2015 17:33:15 +0200 Subject: fix memory leaks reported by -fsanitize Various small leaks here and there. Nothing particularily big, but still good to fix. Found by the sanitizers while running our testcases. Reported-By: gcc -fsanitize Git-Dch: Ignore --- apt-pkg/cachefile.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/cachefile.cc') diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index ea3d45480..690776266 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -65,8 +65,8 @@ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock) if (_config->FindB("pkgCacheFile::Generate", true) == false) { - Map = new MMap(*new FileFd(_config->FindFile("Dir::Cache::pkgcache"), - FileFd::ReadOnly),MMap::Public|MMap::ReadOnly); + FileFd file(_config->FindFile("Dir::Cache::pkgcache"), FileFd::ReadOnly); + Map = new MMap(file, MMap::Public|MMap::ReadOnly); Cache = new pkgCache(Map); if (_error->PendingError() == true) return false; -- cgit v1.2.3