[Libreoffice-commits] core.git: svl/source

Stephan Bergmann sbergman at redhat.com
Mon Dec 14 23:48:47 PST 2015


 svl/source/items/itemset.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f6d1a15206ac13d3034c0c08722dea6102202354
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 15 08:48:14 2015 +0100

    Memory leak
    
    Change-Id: I99da487f0bed527eaacf47642884ae25fb0ae8b1

diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index a0ad76f..1ed7246 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -459,7 +459,9 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
                 // Turns into disabled?
                 if( !rItem.Which() )
                 {
-                    *ppFnd = rItem.Clone(m_pPool);
+                    if (IsInvalidItem(*ppFnd) || (*ppFnd)->Which() != 0) {
+                        *ppFnd = rItem.Clone(m_pPool);
+                    }
                     return nullptr;
                 }
                 else


More information about the Libreoffice-commits mailing list