From: David Kalnischkies Date: Wed, 23 Dec 2015 18:42:53 +0000 (+0100) Subject: fix new[] vs delete mismatch introduced by b3db9d81 X-Git-Tag: 1.1.6~2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/117551478551958d62d9555c595f2990805137c0 fix new[] vs delete mismatch introduced by b3db9d81 And as we are at it lets fix the 'style' issue I introduced with the filefd changes as well. Reported-By: gcc -fsanitize's & cppcheck Git-Dch: Ignore --- diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 9b3618082..496cdee42 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -923,7 +923,7 @@ class FileFdPrivate { /*{{{*/ protected: FileFd * const filefd; size_t buffersize_max = 0; - std::unique_ptr buffer; + std::unique_ptr buffer; unsigned long long buffersize = 0; public: int compressed_fd; @@ -932,7 +932,7 @@ public: APT::Configuration::Compressor compressor; unsigned int openmode; unsigned long long seekpos; - FileFdPrivate(FileFd * const pfilefd) : filefd(pfilefd), buffer(nullptr), + explicit FileFdPrivate(FileFd * const pfilefd) : filefd(pfilefd), buffer(nullptr), compressed_fd(-1), compressor_pid(-1), is_pipe(false), openmode(0), seekpos(0) {}; @@ -1244,7 +1244,7 @@ public: return true; } - GzipFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), gz(nullptr) {} + explicit GzipFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), gz(nullptr) {} virtual ~GzipFileFdPrivate() { InternalClose(""); } #endif }; @@ -1298,7 +1298,7 @@ public: return true; } - Bz2FileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), bz2(nullptr) {} + explicit Bz2FileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), bz2(nullptr) {} virtual ~Bz2FileFdPrivate() { InternalClose(""); } #endif }; @@ -1491,7 +1491,7 @@ public: return true; } - LzmaFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), lzma(nullptr) {} + explicit LzmaFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), lzma(nullptr) {} virtual ~LzmaFileFdPrivate() { InternalClose(""); } #endif }; @@ -1615,7 +1615,7 @@ public: compressor_pid = -1; return Ret; } - PipedFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {} + explicit PipedFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {} virtual ~PipedFileFdPrivate() { InternalClose(""); } }; /*}}}*/ @@ -1694,7 +1694,7 @@ public: virtual bool InternalClose(std::string const &) override { return true; } virtual bool InternalAlwaysAutoClose() const override { return false; } - DirectFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {} + explicit DirectFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {} virtual ~DirectFileFdPrivate() { InternalClose(""); } }; /*}}}*/