Skip to content

Commit

Permalink
fix: Avoid memory leak in events filtering
Browse files Browse the repository at this point in the history
Deallocate a derived-type component before reassignment to that derived-type.
  • Loading branch information
abensonca committed Sep 5, 2024
1 parent a9a201a commit feab823
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions perl/Galacticus/Build/SourceTree/Process/EventHooks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ CODE
{$name}EventBackups => {$name}EventBackups%next
select type (eventHook_ => eventHookBackup%eventHook_)
type is (eventHook{$interfaceType})
if (allocated({$name}Event%hooks_)) deallocate({$name}Event%hooks_)
{$name}Event = eventHook_
class default
call Error_Report('eventHook has incorrect class'//{$location})
Expand Down

0 comments on commit feab823

Please sign in to comment.