[Libreoffice-commits] core.git: lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Mon Feb 27 16:03:39 UTC 2017


 lotuswordpro/source/filter/lwpidxmgr.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 7e07b144554691d4bbb3eb5e821aa0f1a36d1f32
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 27 16:02:49 2017 +0000

    ofz: fix leak
    
    Change-Id: Icf0e75d0e213c4562f4ee57df0537d394031645b

diff --git a/lotuswordpro/source/filter/lwpidxmgr.cxx b/lotuswordpro/source/filter/lwpidxmgr.cxx
index 640c42f..7c03e87 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++)
         {


More information about the Libreoffice-commits mailing list