diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-02-15 19:38:23 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-02-15 19:40:35 +0100 |
commit | 9da54417345c6069d995bdabae7d7dd6de40d1a6 (patch) | |
tree | 767a337bd8628113454b677593c2ea665407f685 /sfx2 | |
parent | c743324292a9994e20353734846b5045199d8e93 (diff) |
coverity#738978: Fix use after free.
This was a corner case after the container types removal.
Change-Id: I2200b7fc2d38946403d289e62ad602a63bd1cf6e
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 08ff451ae243..91cf2e7bda07 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -158,7 +158,6 @@ void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt ) sal_Bool LinkManager::Insert( SvBaseLink* pLink ) { - // No duplicate links inserted for( sal_uInt16 n = 0; n < aLinkTbl.size(); ++n ) { SvBaseLinkRef* pTmp = aLinkTbl[ n ]; @@ -167,9 +166,8 @@ sal_Bool LinkManager::Insert( SvBaseLink* pLink ) delete pTmp; aLinkTbl.erase( aLinkTbl.begin() + n-- ); } - - if( pLink == *pTmp ) - return sal_False; + else if( pLink == *pTmp ) + return sal_False; // No duplicate links inserted } SvBaseLinkRef* pTmp = new SvBaseLinkRef( pLink ); |