diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-14 09:56:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-14 12:02:45 +0000 |
commit | 0332e3a8e968f9f85b40405391120d2f5949fbd2 (patch) | |
tree | 5bb1c10ed24f64d1d3d2a183dd6903c7dafe8f62 /lotuswordpro/source/filter/lwpfrib.cxx | |
parent | coverity#1242888 Unused value (diff) | |
download | core-0332e3a8e968f9f85b40405391120d2f5949fbd2.tar.gz core-0332e3a8e968f9f85b40405391120d2f5949fbd2.zip |
coverity#738972 Use after free
Change-Id: Iba60fc4ff3b10179ebc700467a3d73e7bc7b64c9
Diffstat (limited to 'lotuswordpro/source/filter/lwpfrib.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwpfrib.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index 61d5324a224c..ea90d087c097 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -259,9 +259,10 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) pStyle->SetStyleName(""); pFont = pFoundry->GetFontManger().CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID); pStyle->SetFont(pFont); - IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle); + IXFStyleRet aNewStyle = pXFStyleManager->AddStyle(pStyle); + IXFStyle *pNewStyle = aNewStyle.m_pStyle; m_StyleName = pNewStyle->GetStyleName(); - if (pNewStyle != pStyle) + if (aNewStyle.m_bOrigDeleted) pStyle = NULL; } else @@ -274,9 +275,10 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) pStyle = new XFTextStyle(); pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID); pStyle->SetFont(pFont); - IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle); + IXFStyleRet aNewStyle = pXFStyleManager->AddStyle(pStyle); + IXFStyle *pNewStyle = aNewStyle.m_pStyle; m_StyleName = pNewStyle->GetStyleName(); - if (pNewStyle != pStyle) + if (aNewStyle.m_bOrigDeleted) pStyle = NULL; } } @@ -302,7 +304,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) pFont->SetBackColor(aColor); pStyle->SetFont(pFont); } - m_StyleName = pXFStyleManager->AddStyle(pStyle)->GetStyleName(); + m_StyleName = pXFStyleManager->AddStyle(pStyle).m_pStyle->GetStyleName(); } } } |