summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-02 09:25:02 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-02 12:07:59 +0200
commitbedce5f2b383c38b8fe051e4e63b76e116c5ffb4 (patch)
treeb4a782fb90ea1a90ac8ccd6efde65b451a08e409 /sw/source
parentdff729704687889f960562f0ac6fa62b47897cf9 (diff)
cid#1418980 Resource leak
Change-Id: I3a09b3165503bacbd2bab394eda9adc793f0bff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91546 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxexport.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index f9af8d2937cf..035f50cbeaac 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1210,7 +1210,7 @@ void DocxExport::WriteSettings()
if (rAttributeList.hasElements())
{
- sax_fastparser::FastAttributeList* pAttributeList = sax_fastparser::FastSerializerHelper::createAttrList();
+ rtl::Reference<sax_fastparser::FastAttributeList> xAttributeList = sax_fastparser::FastSerializerHelper::createAttrList();
bool bIsProtectionTrackChanges = false;
// if grabbag protection is not enforced, allow Writer protection to override
bool bEnforced = false;
@@ -1234,7 +1234,7 @@ void DocxExport::WriteSettings()
if (sal_Int32 nToken = DocxStringGetToken(aTokens, rAttribute.Name))
{
OUString sValue = rAttribute.Value.get<OUString>();
- pAttributeList->add(FSNS(XML_w, nToken), sValue.toUtf8());
+ xAttributeList->add(FSNS(XML_w, nToken), sValue.toUtf8());
if ( nToken == XML_edit && sValue == "trackedChanges" )
bIsProtectionTrackChanges = true;
else if ( nToken == XML_edit && sValue == "readOnly" )
@@ -1264,8 +1264,8 @@ void DocxExport::WriteSettings()
if ( bUseGrabBagProtection )
{
- sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
- pFS->singleElementNS(XML_w, XML_documentProtection, xAttributeList);
+ sax_fastparser::XFastAttributeListRef xFastAttributeList(xAttributeList.get());
+ pFS->singleElementNS(XML_w, XML_documentProtection, xFastAttributeList);
}
}