From 1ee6577a0eae3d189d11233bccf90d11e48d771d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 29 Mar 2014 20:58:57 +0000 Subject: [PATCH] coverity#704900 Dereference after null check Change-Id: I5ffac44f4fa48be0a4158c9eb234e94d2a22f5ed --- sw/source/core/layout/flowfrm.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 5b512429d2ae..05c166afe6e4 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1672,14 +1672,15 @@ SwTwips SwFlowFrm::CalcAddLowerSpaceAsLastInTableCell( } } - SwBorderAttrAccess* pAttrAccess = 0L; - if ( !_pAttrs || pFrm != &m_rThis ) + SwBorderAttrAccess* pAttrAccess = NULL; + if (pFrm && (!_pAttrs || pFrm != &m_rThis)) { pAttrAccess = new SwBorderAttrAccess( SwFrm::GetCache(), pFrm ); _pAttrs = pAttrAccess->Get(); } - nAdditionalLowerSpace += _pAttrs->GetULSpace().GetLower(); + if (_pAttrs) + nAdditionalLowerSpace += _pAttrs->GetULSpace().GetLower(); delete pAttrAccess; }