diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-07-26 11:58:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-07-26 22:03:44 +0200 |
commit | 81411dc7c6481db6a90f3841df15c977f8c21205 (patch) | |
tree | 0ee2e2f4c79ba9e03f3de78b87099a9d188406fd /sc | |
parent | 1d42b3da3a0649c45ec030242668e1bc159cb37c (diff) |
Related: rhbz#1602589 silence coverity use_after_free
Change-Id: If5345b6515c45bee2742d1293cd181ab46e8e61b
Reviewed-on: https://gerrit.libreoffice.org/58088
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 35c1d72dbe64..8b73880e718e 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -341,8 +341,11 @@ bool ScChangeAction::IsDeletedIn( const ScChangeAction* p ) const void ScChangeAction::RemoveAllDeletedIn() { //TODO: Not from TopContent, but really this one - while ( pLinkDeletedIn ) - delete pLinkDeletedIn; // Moves up by itself + while (pLinkDeletedIn) + { + // coverity[use_after_free] - Moves up by itself + delete pLinkDeletedIn; + } } bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const @@ -401,8 +404,11 @@ void ScChangeAction::SetDeletedIn( ScChangeAction* p ) void ScChangeAction::RemoveAllDependent() { - while ( pLinkDependent ) - delete pLinkDependent; // Moves up by itself + while (pLinkDependent) + { + // coverity[use_after_free] - Moves up by itself + delete pLinkDependent; + } } DateTime ScChangeAction::GetDateTime() const @@ -830,8 +836,11 @@ ScChangeActionDel::ScChangeActionDel( ScChangeActionDel::~ScChangeActionDel() { DeleteCellEntries(); - while ( pLinkMove ) + while (pLinkMove) + { + // coverity[use_after_free] - Moves up by itself delete pLinkMove; + } } void ScChangeActionDel::AddContent( ScChangeActionContent* pContent ) @@ -1056,6 +1065,7 @@ void ScChangeActionDel::UndoCutOffMoves() { // Restore cut off Moves; delete Entries/Links 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(); short nFrom = pLinkMove->GetCutOffFrom(); short nTo = pLinkMove->GetCutOffTo(); |