It's never a good idea to dereference a freed pointer.

Fixes: lp:1809897
* https://bugs.launchpad.net/kicad/+bug/1809897
This commit is contained in:
Jeff Young 2018-12-27 13:29:40 +00:00
parent bce4a45ab4
commit 4d9b4428fa
1 changed files with 4 additions and 1 deletions

View File

@ -612,8 +612,11 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow()
m_footprint->Value() = m_texts->at( 1 );
size_t i = 2;
for( BOARD_ITEM* item = m_footprint->GraphicalItemsList().GetFirst(); item; item = item->Next() )
BOARD_ITEM* next;
for( BOARD_ITEM* item = m_footprint->GraphicalItemsList().GetFirst(); item; item = next )
{
next = item->Next();
TEXTE_MODULE* textModule = dyn_cast<TEXTE_MODULE*>( item );
if( textModule )