diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-02 14:20:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-02 14:20:45 +0000 |
commit | f31477bb57d3462cafc476bacd00368fd9178af8 (patch) | |
tree | 70c05f8ec8f0731d861432f7d04be54214cc82c4 /lotuswordpro/source | |
parent | 85abe70d7fe8e3ddf32780e816113aecca594a19 (diff) |
fix leak
Change-Id: Ic91bb15cafa97538a61247660044c1af57b59d84
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpfrib.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index 2d6d382b7b94..e9542e488c75 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -104,18 +104,18 @@ LwpFrib::~LwpFrib() LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt8 fribtag,sal_uInt8 editID) { //Read Modifier - ModifierInfo* pModInfo = nullptr; + std::unique_ptr<ModifierInfo> xModInfo; if(fribtag & FRIB_TAG_MODIFIER) { - pModInfo = new ModifierInfo; - pModInfo->CodePage = 0; - pModInfo->FontID = 0; - pModInfo->RevisionType = 0; - pModInfo->RevisionFlag = false; - pModInfo->HasCharStyle = false; - pModInfo->HasLangOverride = false; - pModInfo->HasHighlight = false; - ReadModifiers( pObjStrm, pModInfo ); + xModInfo.reset(new ModifierInfo); + xModInfo->CodePage = 0; + xModInfo->FontID = 0; + xModInfo->RevisionType = 0; + xModInfo->RevisionFlag = false; + xModInfo->HasCharStyle = false; + xModInfo->HasLangOverride = false; + xModInfo->HasHighlight = false; + ReadModifiers(pObjStrm, xModInfo.get()); } //Read frib data @@ -199,9 +199,9 @@ LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt } //Do not know why the fribTag judgement is necessary, to be checked with - if ( fribtag & FRIB_TAG_MODIFIER ) + if (fribtag & FRIB_TAG_MODIFIER) { - newFrib->SetModifiers(pModInfo); + newFrib->SetModifiers(xModInfo.release()); } newFrib->m_nFribType = fribtype; |