summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/edit/edglbldc.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx
index ec77cb82287a..e2f4dd71f7bf 100644
--- a/sw/source/core/edit/edglbldc.cxx
+++ b/sw/source/core/edit/edglbldc.cxx
@@ -67,7 +67,7 @@ void SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
const SwSection* pSect = rSectFormats[ --n ]->GetGlobalDocSection();
if( pSect )
{
- SwGlblDocContent* pNew;
+ SwGlblDocContent* pNew = nullptr;
switch( pSect->GetType() )
{
case TOX_HEADER_SECTION:
@@ -81,7 +81,7 @@ void SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
pNew = new SwGlblDocContent( pSect );
break;
}
- if( !rArr.insert( pNew ).second )
+ if( pNew && !rArr.insert( pNew ).second )
delete pNew;
}
}