summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-14 20:51:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-14 21:09:47 +0100
commitb8d18c1b27e97e14a83338c6b18239637b744834 (patch)
treeef57eef84a2dac52f6e7d4bc1be3f8bb059182b4 /lotuswordpro
parent5d4c63c815c38106d1d80e817e96c5cb0fbaaccf (diff)
CID#738972 use after free
Change-Id: I3c1329a55b53365945406c515ff4e8e72792dcb6
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpfrib.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx
index 9ef736dec302..ca91ef963855 100644
--- a/lotuswordpro/source/filter/lwpfrib.cxx
+++ b/lotuswordpro/source/filter/lwpfrib.cxx
@@ -255,8 +255,11 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry)
pStyle->SetStyleName(A2OUSTR(""));
pFont = pFoundry->GetFontManger()->CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID);
pStyle->SetFont(pFont);
- m_StyleName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
- }
+ IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle);
+ m_StyleName = pNewStyle->GetStyleName();
+ if (pNewStyle != pStyle)
+ pStyle = NULL;
+ }
else
m_StyleName = pNamedStyle->GetStyleName();
}
@@ -267,7 +270,10 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry)
pStyle = new XFTextStyle();
pFont = pFoundry->GetFontManger()->CreateFont(m_pModifiers->FontID);
pStyle->SetFont(pFont);
- m_StyleName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
+ IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle);
+ m_StyleName = pNewStyle->GetStyleName();
+ if (pNewStyle != pStyle)
+ pStyle = NULL;
}
}