Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateDynamicArrayEnum pEnum not freed #50412

Closed
tmds opened this issue Mar 30, 2021 · 2 comments · Fixed by #50471
Closed

CreateDynamicArrayEnum pEnum not freed #50412

tmds opened this issue Mar 30, 2021 · 2 comments · Fixed by #50471
Labels
area-TypeSystem-coreclr untriaged New issue has not been triaged by the area owner

Comments

@tmds
Copy link
Member

tmds commented Mar 30, 2021

Also from coverity.

CreateDynamicArrayEnum values aren't freed on error paths. For example:

IfFailGo( HENUMInternal::CreateDynamicArrayEnum( mdtMethodDef, &pEnum) );
// add all methods to the dynamic array
for (index = ridStartMethod; index < ridEndMethod; index++ )
{
RID rid;
IfFailGo(pMiniMd->GetMethodRid(index, &rid));
IfFailGo(HENUMInternal::AddElementToEnum(
pEnum,
TokenFromRid(rid, mdtMethodDef)));
}

The allocated pEnum is not freed in ErrExit.

Are these accepted leaks? Or should we fix them?

cc @jkotas @janvorli @omajid

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 30, 2021
@janvorli
Copy link
Member

Thank you for reporting this, it should be fixed.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 31, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 1, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-TypeSystem-coreclr untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants