src/lib/VSDFieldList.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit d8ee1ffbf7b2918e927a96502fd182cfcf50e1f6 Author: David Tardon <dtar...@redhat.com> Date: Fri Apr 7 16:10:38 2017 +0200 ofz#989 do not leak existing field with the same ID Change-Id: Iac76df2ae09965732ae5fd42036fdb59886f071f diff --git a/src/lib/VSDFieldList.cpp b/src/lib/VSDFieldList.cpp index 3f436b4..2f470a5 100644 --- a/src/lib/VSDFieldList.cpp +++ b/src/lib/VSDFieldList.cpp @@ -216,12 +216,14 @@ void libvisio::VSDFieldList::addFieldList(unsigned id, unsigned level) void libvisio::VSDFieldList::addTextField(unsigned id, unsigned level, int nameId, int formatStringId) { - m_elements[id] = new VSDTextField(id, level, nameId, formatStringId); + if (m_elements.find(id) == m_elements.end()) + m_elements[id] = new VSDTextField(id, level, nameId, formatStringId); } void libvisio::VSDFieldList::addNumericField(unsigned id, unsigned level, unsigned short format, double number, int formatStringId) { - m_elements[id] = new VSDNumericField(id, level, format, number, formatStringId); + if (m_elements.find(id) == m_elements.end()) + m_elements[id] = new VSDNumericField(id, level, format, number, formatStringId); } void libvisio::VSDFieldList::handle(VSDCollector *collector) const _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits