summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-09 20:43:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-09 21:20:12 +0000
commitf1529383d4ce70fb23d0cb6e31b54e5a9da76b9b (patch)
tree9ee7b72e585df8dc54d6bfedf7984038bea9de8c /filter
parente37886a2f6e6eab87373e502f036d56ab85bb445 (diff)
coverity#705649 Resource leak
Change-Id: I4899851af28b20a20c7b07301c22ddacdbb89b27
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index cdc30bc405c9..ccf0dffcb72b 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4887,7 +4887,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
{
SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
+ bool bDeleteImpRec = true;
SvxMSDffImportRec* pTextImpRec = pImpRec;
+ bool bDeleteTextImpRec = false;
// fill Import Record with data
pImpRec->nShapeId = rObjData.nShapeId;
@@ -5083,6 +5085,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect);
pTextImpRec = new SvxMSDffImportRec(*pImpRec);
+ bDeleteTextImpRec = true;
// the vertical paragraph indents are part of the BoundRect,
// here we 'remove' them by calculating
@@ -5362,6 +5365,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
{
pImpRec->pObj = pOrgObj;
rImportData.aRecords.insert( pImpRec );
+ bDeleteImpRec = false;
+ if (pImpRec == pTextImpRec)
+ bDeleteTextImpRec = false;
}
if( pTextObj && (pOrgObj != pTextObj) )
@@ -5370,6 +5376,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
pImpRec->nShapeId |= 0x8000000;
pTextImpRec->pObj = pTextObj;
rImportData.aRecords.insert( pTextImpRec );
+ bDeleteTextImpRec = false;
+ if (pTextImpRec == pImpRec)
+ bDeleteImpRec = false;
}
// entry in the z-order-list in order to complement the pointer to this object
@@ -5383,12 +5392,12 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
( ( (sal_uLong)pImpRec->aTextId.nTxBxS ) << 16 )
+ pImpRec->aTextId.nSequence, pObj );
}
- else
- {
- if (pTextImpRec != pImpRec)
- delete pTextImpRec;
+
+ if (bDeleteImpRec)
delete pImpRec;
- }
+
+ if (bDeleteTextImpRec)
+ delete pTextImpRec;
}
return pObj;