summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-05-27 16:25:43 +0200
committerMichael Vogt <mvo@debian.org>2014-05-27 16:25:43 +0200
commit21ea1dbb50176a89e7f456f9b31220ff3097fdf2 (patch)
treef536b7ad06a46286b21a93254524af2da4e801bf /apt-pkg
parent9518b448743e9030d854fcbb104516dd5ba648f6 (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 'apt-pkg')
-rw-r--r--apt-pkg/contrib/fileutl.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index b77c7ff7f..bfd958183 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1241,7 +1241,8 @@ bool FileFd::OpenInternDescriptor(unsigned int const Mode, APT::Configuration::C
if (d->lzma == NULL)
d->lzma = new FileFdPrivate::LZMAFILE;
d->lzma->file = (FILE*) compress_struct;
- d->lzma->stream = LZMA_STREAM_INIT;
+ lzma_stream tmp_stream = LZMA_STREAM_INIT;
+ d->lzma->stream = tmp_stream;
if ((Mode & ReadWrite) == ReadWrite)
return FileFdError("ReadWrite mode is not supported for file %s", FileName.c_str());