coverity#984443 Use after free

Change-Id: I3736de989ab9978ba20883ffcad635729048e4f9
Reviewed-on: https://gerrit.libreoffice.org/2198
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Norbert Thiebaud
2013-02-17 11:43:59 -06:00
committed by Caolán McNamara
parent 51a83689fe
commit f7ddccdac0

View File

@@ -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();