summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dochdl/gloshdl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-03 10:10:57 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-03 16:30:32 +0100
commit1573a63339c0e8d3a88a3c3ec520a2c4e75655a4 (patch)
treee7a8c9b714c7a042087dbfe6dd7b692cd99de6c0 /sw/source/uibase/dochdl/gloshdl.cxx
parent2b862165fac771f69c22aba61993e53abf76540f (diff)
coverity#1242498 Resource leak
Change-Id: I832bbf09756e616877621f186ddba17784de9f43
Diffstat (limited to 'sw/source/uibase/dochdl/gloshdl.cxx')
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 7b17c840f150..84cf7370fd22 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -161,7 +161,7 @@ OUString SwGlossaryHdl::GetGroupName( size_t nId, OUString* pTitle )
if(pTitle)
{
SwTextBlocks* pGroup = rStatGlossaries.GetGroupDoc(sRet, false);
- if(pGroup && !pGroup->GetError())
+ if (pGroup && !pGroup->GetError())
{
*pTitle = pGroup->GetName();
if (pTitle->isEmpty())
@@ -172,7 +172,10 @@ OUString SwGlossaryHdl::GetGroupName( size_t nId, OUString* pTitle )
rStatGlossaries.PutGroupDoc( pGroup );
}
else
+ {
+ delete pGroup;
sRet = OUString();
+ }
}
return sRet;
}