fix(Environment): Possibility of memory leak in Windows Environment nodeIdImpl? #3823

This commit is contained in:
Alex Fabijanic 2022-10-06 21:19:04 +02:00
parent 1181fb2485
commit d11e48f851
2 changed files with 3 additions and 1 deletions

View File

@ -216,7 +216,8 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id)
}
else if (rc != ERROR_SUCCESS)
{
return;
delete[] reinterpret_cast<char*>(pAdapterInfo);
throw SystemException("cannot get network adapter list");
}
if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR)
{

View File

@ -167,6 +167,7 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id)
}
else if (rc != ERROR_SUCCESS)
{
delete[] reinterpret_cast<char*>(pAdapterInfo);
throw SystemException("cannot get network adapter list");
}
try