summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-27 16:02:49 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-27 16:03:13 +0000
commit7e07b144554691d4bbb3eb5e821aa0f1a36d1f32 (patch)
tree4624316b852f553c2f71a93dae3113771f0a46fc
parentbd8c68c99cce51a3368d8ddfd6e11dccb72d8f49 (diff)
ofz: fix leak
Change-Id: Icf0e75d0e213c4562f4ee57df0537d394031645b
-rw-r--r--lotuswordpro/source/filter/lwpidxmgr.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/lotuswordpro/source/filter/lwpidxmgr.cxx b/lotuswordpro/source/filter/lwpidxmgr.cxx
index 640c42f04aa9..7c03e8733b65 100644
--- a/lotuswordpro/source/filter/lwpidxmgr.cxx
+++ b/lotuswordpro/source/filter/lwpidxmgr.cxx
@@ -88,19 +88,19 @@ void LwpIndexManager::Read(LwpSvStream* pStrm)
//Read index obj
LwpObjectHeader ObjHdr;
ObjHdr.Read(*pStrm);
- LwpObjectStream* pObjStrm = new LwpObjectStream(pStrm, ObjHdr.IsCompressed(),
- static_cast<sal_uInt16>(ObjHdr.GetSize()) );
+ std::unique_ptr<LwpObjectStream> xObjStrm(new LwpObjectStream(pStrm, ObjHdr.IsCompressed(),
+ static_cast<sal_uInt16>(ObjHdr.GetSize())));
if( ObjHdr.GetTag() == VO_ROOTLEAFOBJINDEX )
{
- ReadLeafData(pObjStrm);
- ReadTimeTable(pObjStrm);
- delete pObjStrm;
+ ReadLeafData(xObjStrm.get());
+ ReadTimeTable(xObjStrm.get());
+ xObjStrm.reset();
}
else
{
- ReadRootData(pObjStrm);
- delete pObjStrm;
+ ReadRootData(xObjStrm.get());
+ xObjStrm.reset();
for (sal_uInt16 k = 0; k < m_nLeafCount; k++)
{