summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-02-15 19:38:23 +0100
committerJan Holesovsky <kendy@suse.cz>2013-02-15 19:40:35 +0100
commit9da54417345c6069d995bdabae7d7dd6de40d1a6 (patch)
tree767a337bd8628113454b677593c2ea665407f685 /sfx2
parentc743324292a9994e20353734846b5045199d8e93 (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.cxx6
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 );