Skip to content

Commit a6bea35

Browse files
starseekercshorler
authored andcommitted
Delete temporary element after use
1 parent ae933ed commit a6bea35

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/clstepcore/Registry.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ void Registry::RemoveType( const char * n ) {
235235
*/
236236
void Registry::RemoveClones( const EntityDescriptor & e ) {
237237
const SchRename * alts = e.AltNameList();
238-
struct Element * tmp;
239238

240239
while( alts ) {
241-
tmp = new Element;
240+
struct Element * tmp = new Element;
242241
tmp->key = ( char * ) alts->objName();
243242
SC_HASHsearch( primordialSwamp, tmp, HASH_DELETE );
244243
alts = alts->next;
244+
delete tmp;
245245
}
246246
}
247247

0 commit comments

Comments
 (0)