From 79fa84ccb9b45b149843ac88e4d662f2a09e94bf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 14 Mar 2014 15:46:05 +0000 Subject: coverity#705828 Dereference before null check Change-Id: Ie76ee86f6ae48012c92a3f06ad1372f126f1ea29 --- sc/source/filter/html/htmlpars.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index e8f69e926e73..02602927f373 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -266,10 +266,8 @@ ScHTMLLayoutParser::~ScHTMLLayoutParser() delete pS->pLocalColOffset; delete pS; } - if ( pLocalColOffset ) - delete pLocalColOffset; - if ( pColOffset ) - delete pColOffset; + delete pLocalColOffset; + delete pColOffset; if ( pTables ) { for( OuterMap::const_iterator it = pTables->begin(); it != pTables->end(); ++it) @@ -1349,8 +1347,7 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) nColOffsetStart = pS->nColOffsetStart; bFirstRow = pS->bFirstRow; xLockedList = pS->xLockedList; - if ( pLocalColOffset ) - delete pLocalColOffset; + delete pLocalColOffset; pLocalColOffset = pS->pLocalColOffset; delete pActEntry; // pActEntry is kept around if a table is started in the same row @@ -1370,8 +1367,7 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) { ScHTMLTableStackEntry* pS = aTableStack.top(); aTableStack.pop(); - if ( pLocalColOffset ) - delete pLocalColOffset; + delete pLocalColOffset; pLocalColOffset = pS->pLocalColOffset; delete pS; } -- cgit