Skip to content

Fix memory leak in Assembler::EmitGenericParamConstraints#124586

Open
tpa95 wants to merge 2 commits intodotnet:mainfrom
tpa95:fix/coreclr-memory-leak
Open

Fix memory leak in Assembler::EmitGenericParamConstraints#124586
tpa95 wants to merge 2 commits intodotnet:mainfrom
tpa95:fix/coreclr-memory-leak

Conversation

@tpa95
Copy link
Contributor

@tpa95 tpa95 commented Feb 19, 2026

Free the per-parameter buffers stored in pConstraintsArr and pGPConstraintsArr before deleting the pointer arrays. Previously only the outer arrays were deleted, leaking the inner allocations for each type parameter.

The errors were discovered using the Svace static analyzer. I didn't observe any in practice.

Found by Linux Verification Center (linuxtesting.org) with SVACE.
Reporter: Pavel Tikhomirov (Tihomirov-P@gaz-is.ru).
Organization: Gazinformservice (resp@gaz-is.ru).

Free the per-parameter buffers stored in pConstraintsArr and pGPConstraintsArr before deleting the pointer arrays. Previously only the outer arrays were deleted, leaking the inner allocations for each type parameter.
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 19, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ILTools-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments