Skip to content

Commit d11e48f

Browse files
committed
fix(Environment): Possibility of memory leak in Windows Environment nodeIdImpl? #3823
1 parent 1181fb2 commit d11e48f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Foundation/src/Environment_WIN32U.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id)
216216
}
217217
else if (rc != ERROR_SUCCESS)
218218
{
219-
return;
219+
delete[] reinterpret_cast<char*>(pAdapterInfo);
220+
throw SystemException("cannot get network adapter list");
220221
}
221222
if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR)
222223
{

Foundation/src/Environment_WINCE.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id)
167167
}
168168
else if (rc != ERROR_SUCCESS)
169169
{
170+
delete[] reinterpret_cast<char*>(pAdapterInfo);
170171
throw SystemException("cannot get network adapter list");
171172
}
172173
try

0 commit comments

Comments
 (0)