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 );
|
auto entryIt = m_changedItems.find( parent );
|
||||||
|
|
||||||
if( entryIt != m_changedItems.end() )
|
if( entryIt != m_changedItems.end() )
|
||||||
|
{
|
||||||
|
free( aCopy );
|
||||||
return *this; // item has been already modified once
|
return *this; // item has been already modified once
|
||||||
|
}
|
||||||
|
|
||||||
makeEntry( parent, CHT_MODIFY | aExtraFlags, aCopy );
|
makeEntry( parent, CHT_MODIFY | aExtraFlags, aCopy );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue