Kaydet (Commit) 81411dc7 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: rhbz#1602589 silence coverity use_after_free

Change-Id: If5345b6515c45bee2742d1293cd181ab46e8e61b
Reviewed-on: https://gerrit.libreoffice.org/58088
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1d42b3da
...@@ -341,8 +341,11 @@ bool ScChangeAction::IsDeletedIn( const ScChangeAction* p ) const ...@@ -341,8 +341,11 @@ bool ScChangeAction::IsDeletedIn( const ScChangeAction* p ) const
void ScChangeAction::RemoveAllDeletedIn() void ScChangeAction::RemoveAllDeletedIn()
{ {
//TODO: Not from TopContent, but really this one //TODO: Not from TopContent, but really this one
while ( pLinkDeletedIn ) while (pLinkDeletedIn)
delete pLinkDeletedIn; // Moves up by itself {
// coverity[use_after_free] - Moves up by itself
delete pLinkDeletedIn;
}
} }
bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const
...@@ -401,8 +404,11 @@ void ScChangeAction::SetDeletedIn( ScChangeAction* p ) ...@@ -401,8 +404,11 @@ void ScChangeAction::SetDeletedIn( ScChangeAction* p )
void ScChangeAction::RemoveAllDependent() void ScChangeAction::RemoveAllDependent()
{ {
while ( pLinkDependent ) while (pLinkDependent)
delete pLinkDependent; // Moves up by itself {
// coverity[use_after_free] - Moves up by itself
delete pLinkDependent;
}
} }
DateTime ScChangeAction::GetDateTime() const DateTime ScChangeAction::GetDateTime() const
...@@ -830,8 +836,11 @@ ScChangeActionDel::ScChangeActionDel( ...@@ -830,8 +836,11 @@ ScChangeActionDel::ScChangeActionDel(
ScChangeActionDel::~ScChangeActionDel() ScChangeActionDel::~ScChangeActionDel()
{ {
DeleteCellEntries(); DeleteCellEntries();
while ( pLinkMove ) while (pLinkMove)
{
// coverity[use_after_free] - Moves up by itself
delete pLinkMove; delete pLinkMove;
}
} }
void ScChangeActionDel::AddContent( ScChangeActionContent* pContent ) void ScChangeActionDel::AddContent( ScChangeActionContent* pContent )
...@@ -1056,6 +1065,7 @@ void ScChangeActionDel::UndoCutOffMoves() ...@@ -1056,6 +1065,7 @@ void ScChangeActionDel::UndoCutOffMoves()
{ // Restore cut off Moves; delete Entries/Links { // Restore cut off Moves; delete Entries/Links
while ( pLinkMove ) while ( pLinkMove )
{ {
// coverity[deref_arg] - the call on delete pLinkMove at the block end Moves a new entry into pLinkMode by itself
ScChangeActionMove* pMove = pLinkMove->GetMove(); ScChangeActionMove* pMove = pLinkMove->GetMove();
short nFrom = pLinkMove->GetCutOffFrom(); short nFrom = pLinkMove->GetCutOffFrom();
short nTo = pLinkMove->GetCutOffTo(); short nTo = pLinkMove->GetCutOffTo();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment