Skip to content

Fix memory leak in Assembler::EmitGenericParamConstraints#124586

Merged
jkotas merged 4 commits intodotnet:mainfrom
tpa95:fix/coreclr-memory-leak
Feb 26, 2026
Merged

Fix memory leak in Assembler::EmitGenericParamConstraints#124586
jkotas merged 4 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.

@jkotas
Copy link
Member

jkotas commented Feb 26, 2026

/ba-g infrastructure timeout

@jkotas jkotas merged commit 7a5e8fc into dotnet:main Feb 26, 2026
117 of 123 checks passed
@tpa95 tpa95 deleted the fix/coreclr-memory-leak branch February 27, 2026 05:08
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