Skip to content

CreateDynamicArrayEnum pEnum not freed #50412

@tmds

Description

@tmds

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions