summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-31 21:11:57 +0000
committerDavid Tardon <dtardon@redhat.com>2015-03-27 08:07:02 +0000
commit96e48976d25fb32d31fa5a128cfb3de103260576 (patch)
tree9bbed2dc1c20fa9237cfbce6b3e92a0cc8b0ee9c
parent31433d007cce7d36897277a875c25c5b102e15aa (diff)
coverity#1267678 this is surely backwards (gold)
surely we clone from the source and return the newly created entry. Presumably this doesn't break all the time because aCloneLink is generally set ? coverity#1267678 Resource leak Change-Id: I3e02dfaef371e006f1510b186cdd881c991ef2cf (cherry picked from commit 9f1ecd3ac35f06746fe2a12ca52899f664679de5) Reviewed-on: https://gerrit.libreoffice.org/15023 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r--svtools/source/contnr/treelist.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index f60b1c9247e2..a0fd4ca1aace 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -355,8 +355,8 @@ SvTreeListEntry* SvTreeList::CloneEntry( SvTreeListEntry* pSource ) const
if( aCloneLink.IsSet() )
return (SvTreeListEntry*)aCloneLink.Call( pSource );
SvTreeListEntry* pEntry = CreateEntry();
- pSource->Clone( pEntry );
- return pSource;
+ pEntry->Clone(pSource);
+ return pEntry;
}
SvTreeListEntry* SvTreeList::CreateEntry() const