hwpfilter/source/hwpread.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit efa8e32389ddd1db4e7b5b88856436fdc7061733 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Aug 28 12:28:22 2017 +0100 ofz#3160 Direct-leak Change-Id: I6dcc35aaa06c2599a4524194e5e633cd4e36474e Reviewed-on: https://gerrit.libreoffice.org/41634 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx index 8b0c877c1f98..826272f8eb74 100644 --- a/hwpfilter/source/hwpread.cxx +++ b/hwpfilter/source/hwpread.cxx @@ -21,6 +21,7 @@ #include <comphelper/newarray.hxx> +#include <assert.h> #include <list> #include "hwpfile.h" @@ -459,12 +460,14 @@ bool Picture::Read(HWPFile & hwpf) if (pictype == PICTYPE_DRAW) { - hmem = new HMemIODev(reinterpret_cast<char *>(follow.data()), follow_block_size); + HMemIODev* pOldMem = hmem; + HMemIODev* pNewMem = new HMemIODev(reinterpret_cast<char *>(follow.data()), follow_block_size); + hmem = pNewMem; LoadDrawingObjectBlock(this); style.cell = picinfo.picdraw.hdo; - delete hmem; - - hmem = nullptr; + assert(hmem == pNewMem); + delete pNewMem; + hmem = pOldMem; } else if (follow_block_size >= 4) {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits