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/contents.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ftparchive/contents.cc') diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index 7a1fb779e..91dd2b8bd 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -302,7 +302,18 @@ void GenContents::DoPrint(FILE *Out,GenContents::Node *Top, char *Buf) DoPrint(Out,Top->BTreeRight,Buf); } /*}}}*/ - +// ContentsExtract Constructor /*{{{*/ +ContentsExtract::ContentsExtract() + : Data(0), MaxSize(0), CurSize(0) +{ +}; + /*}}}*/ +// ContentsExtract Destructor /*{{{*/ +ContentsExtract::~ContentsExtract() +{ + free(Data); +}; + /*}}}*/ // ContentsExtract::Read - Read the archive /*{{{*/ // --------------------------------------------------------------------- /* */ -- cgit v1.2.3