Kaydet (Commit) f7ddccda authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud Kaydeden (comit) Caolán McNamara

coverity#984443 Use after free

Change-Id: I3736de989ab9978ba20883ffcad635729048e4f9
Reviewed-on: https://gerrit.libreoffice.org/2198Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 51a83689
......@@ -932,6 +932,10 @@ static SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, bool &rbEmpty,
SwFtnFrm* pRet = (SwFtnFrm*)pFtnCont->Lower();
while( pRet ) // look for endnotes
{
/* CollectEndNode can destroy pRet so we need to get the
next early
*/
SwFtnFrm* pRetNext = (SwFtnFrm*)pRet->GetNext();
if( pRet->GetAttr()->GetFtn().IsEndNote() )
{
if( pRet->GetMaster() )
......@@ -944,7 +948,7 @@ static SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, bool &rbEmpty,
else
return pRet; // Found
}
pRet = (SwFtnFrm*)pRet->GetNext();
pRet = pRetNext;
}
}
pCol = (SwColumnFrm*)pCol->GetNext();
......
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