From 21ea1dbb50176a89e7f456f9b31220ff3097fdf2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 27 May 2014 16:25:43 +0200 Subject: use free() instead of delete() when realloc is used ContentsExtract::~ContentsExtract() needs to use free() because Data got allocated via realloc() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer --- ftparchive/cachedb.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ftparchive/cachedb.cc') diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index e56deae1e..12eac20d8 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -32,6 +32,19 @@ #include /*}}}*/ +CacheDB::CacheDB(std::string const &DB) + : Dbp(0), Fd(NULL), DebFile(0) +{ + TmpKey[0]='\0'; + ReadyDB(DB); +}; + +CacheDB::~CacheDB() +{ + ReadyDB(); + delete DebFile; +}; + // CacheDB::ReadyDB - Ready the DB2 /*{{{*/ // --------------------------------------------------------------------- /* This opens the DB2 file for caching package information */ -- cgit v1.2.3