Skip to content

Commit

Permalink
Merge branch 'mr/pmderodat/valgrind' into 'master'
Browse files Browse the repository at this point in the history
libadalang-env_hooks.adb: fix a recently introduced memory leak

See merge request eng/libadalang/libadalang!1693
  • Loading branch information
pmderodat committed Jul 10, 2024
2 parents 4835aac + 0a78876 commit 9aa599e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extensions/src/libadalang-env_hooks.adb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ package body Libadalang.Env_Hooks is
-- we wanted to return, but if we did that we would not
-- have updated the `Referenced_Units` vector to include
-- the fact that `From_Unit` references the renamed unit.

if Is_Last then
Unit := Unwrap_Unit (Comp_Unit.Unit);
end if;
Expand All @@ -512,11 +513,14 @@ package body Libadalang.Env_Hooks is
end;
else
-- We're on the last portion of the name: return

if Is_Last then
Dec_Ref (Internal_Name);
return;
end if;

-- Else, just resolve the next portion of the given name

Step (Name, Index + 1);
end if;

Expand Down

0 comments on commit 9aa599e

Please sign in to comment.