summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-15 09:25:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-15 13:49:09 +0100
commit3d0988b8ca11eb8e80a3eae5f033512fb9bab0ce (patch)
tree9dc6761aaee3c88a0cc02d976348f2dafebbc257 /sw
parent0ece187f92f9f87ae69b957c498cad8dcce56232 (diff)
coverity#982478 Dereference after null check
maybe sort of can be considered a regression from commit 733b831970204059b9d89eff203551d6d3bf4bbe Date: Tue Jan 5 16:37:41 2010 +0100 swunolocking1: swtypes.hxx: rename frame anchor types enum RndStdIds: rename frame anchor types (FLY_*) to be more intuitive. where if (0 == (pAnchorPos = pAnch->GetCntntAnchor())) bCallMake = sal_False; turned to if (pAnchorPos) bCallMake = sal_False; but there would always be a following de-ref of a potential NULL pAnchorPos which wasn't FLY_AT_PAGE Change-Id: I808b4f178887ab6149e38bab6e36eb68d7a1eb29
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doclay.cxx7
1 files changed, 1 insertions, 6 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 865324ac2bf5..288ba1fa0fa9 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -304,7 +304,6 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
SwFrmFmt* pFrmFmt, bool bCalledFromShell )
{
SwFlyFrmFmt* pFmt = 0;
- bool bCallMake = true;
if ( !pAnchorPos && (FLY_AT_PAGE != eAnchorType) )
{
const SwFmtAnchor* pAnch;
@@ -316,15 +315,11 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
if ( (FLY_AT_PAGE != pAnch->GetAnchorId()) )
{
pAnchorPos = pAnch->GetCntntAnchor();
- if (pAnchorPos)
- {
- bCallMake = false;
- }
}
}
}
- if( bCallMake )
+ if (pAnchorPos)
{
if( !pFrmFmt )
pFrmFmt = getIDocumentStylePoolAccess().GetFrmFmtFromPool( RES_POOLFRM_FRAME );