ofz#3160 Direct-leak

Change-Id: I6dcc35aaa06c2599a4524194e5e633cd4e36474e
Reviewed-on: https://gerrit.libreoffice.org/41634
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2017-08-28 12:28:22 +01:00
parent 474178acd1
commit efa8e32389

View File

@ -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)
{