Kaydet (Commit) 5967bae7 authored tarafından Noel Grandin's avatar Noel Grandin

fix bug in SwEditShell::GetGlobalDocContent

ever since
   commit 84a3db80
   Date:   Mon Sep 18 23:08:29 2000 +0000
   initial import

where it could insert an uninitialised pointer into the
SwGlblDocContents sorted vector

Change-Id: Id58778444593c39b5f80bac3a6dab8e14404030a
Reviewed-on: https://gerrit.libreoffice.org/59932
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 437d5d30
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment