mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-10 21:40:12 +00:00
fix memory leak
When staging a commit for an object that has already been modified, there is a Clone() made for the hypothetical entry. We need to free it if we are not storing a new entry.
This commit is contained in:
parent
d30ac2967a
commit
d83cff63f6
@ -141,7 +141,10 @@ COMMIT& COMMIT::createModified( EDA_ITEM* aItem, EDA_ITEM* aCopy, int aExtraFlag
|
||||
auto entryIt = m_changedItems.find( parent );
|
||||
|
||||
if( entryIt != m_changedItems.end() )
|
||||
{
|
||||
free( aCopy );
|
||||
return *this; // item has been already modified once
|
||||
}
|
||||
|
||||
makeEntry( parent, CHT_MODIFY | aExtraFlags, aCopy );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user