diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-12-23 19:42:53 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-12-23 19:42:53 +0100 |
commit | 117551478551958d62d9555c595f2990805137c0 (patch) | |
tree | fdc59a78b016cd0d772570d567075f40e11097dc /apt-pkg/contrib/fileutl.cc | |
parent | 8d968cc2d1e11da81f3bab878c1a413a97ca27ed (diff) |
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
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r-- | apt-pkg/contrib/fileutl.cc | 14 |
1 files changed, 7 insertions, 7 deletions
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<char> buffer; + std::unique_ptr<char[]> 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(""); } }; /*}}}*/ |