diff options
author | Michael Vogt <mvo@debian.org> | 2014-05-27 16:25:43 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-05-27 16:25:43 +0200 |
commit | 21ea1dbb50176a89e7f456f9b31220ff3097fdf2 (patch) | |
tree | f536b7ad06a46286b21a93254524af2da4e801bf /ftparchive/cachedb.cc | |
parent | 9518b448743e9030d854fcbb104516dd5ba648f6 (diff) |
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
Diffstat (limited to 'ftparchive/cachedb.cc')
-rw-r--r-- | ftparchive/cachedb.cc | 13 |
1 files changed, 13 insertions, 0 deletions
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 <apti18n.h> /*}}}*/ +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 */ |