Browse Source

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.
pull/17/head
Seth Hillbrand 8 years ago
parent
commit
d83cff63f6
  1. 3
      common/commit.cpp

3
common/commit.cpp

@ -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…
Cancel
Save