diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-12-15 08:48:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-12-15 08:48:41 +0100 |
commit | 6502c0dd8338c05dc4dab323099bb9062ff3d131 (patch) | |
tree | e0a91cf19747990f674f9cdd7dd968d067f14c5a /svl | |
parent | f6d1a15206ac13d3034c0c08722dea6102202354 (diff) |
...and this looks like a memory leak, too
Change-Id: I5e203fe8b58d687c0c294c75e385f0bbc858ba07
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/itemset.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 1ed7246ac47b..a4e2c8a33702 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -20,6 +20,7 @@ #include <string.h> +#include <cassert> #include <cstdarg> #include <libxml/xmlwriter.h> @@ -452,7 +453,12 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich // Will 'dontcare' or 'disabled' be overwritten with some real value? if ( rItem.Which() && ( IsInvalidItem(*ppFnd) || !(*ppFnd)->Which() ) ) { + auto const old = *ppFnd; *ppFnd = &m_pPool->Put( rItem, nWhich ); + if (!IsInvalidItem(old)) { + assert(old->Which() == 0); + delete old; + } return *ppFnd; } |