summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-08-01 14:50:54 +0200
committerMichael Stahl <mstahl@redhat.com>2014-08-04 12:49:59 +0000
commit02f0102b8bd7793ddd2fe7a54c46d41b9a608cec (patch)
tree681ab6c40925a32a71cc6361cf538bced70d7c23 /sw
parent4189b715999bf9ebb0cd04a0c610a7b514e28d1b (diff)
prevent memory leak
Found by Lsan. Returning this or a heap allocated object asks for trouble. Let the caller handle it and return null instead of this. Change-Id: I7586e103bef5a8c2727adfe214b052d6962d4467 Reviewed-on: https://gerrit.libreoffice.org/10716 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docfly.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index f2b8466d2e1e..759bbd445af5 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -453,7 +453,7 @@ void SwDoc::CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet& rSet)
{
if (IsInvalidItem(pItem))
continue;
- const SfxPoolItem* pResult = pItem;
+ const SfxPoolItem* pResult = NULL;
switch(pItem->Which())
{
@@ -494,7 +494,7 @@ void SwDoc::CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet& rSet)
}
}
- if(pResult != pItem)
+ if(pResult)
{
rSet.Put(*pResult);
delete pResult;