We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba8fbf3 commit 3b11dbfCopy full SHA for 3b11dbf
src/node_os.cc
@@ -199,6 +199,9 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
199
return args.GetReturnValue().SetUndefined();
200
}
201
202
+ auto cleanup =
203
+ OnScopeLeave([&]() { uv_free_interface_addresses(interfaces, count); });
204
+
205
Local<Value> no_scope_id = Integer::New(isolate, -1);
206
LocalVector<Value> result(isolate);
207
result.reserve(count * 7);
@@ -253,7 +256,6 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
253
256
254
257
255
258
- uv_free_interface_addresses(interfaces, count);
259
args.GetReturnValue().Set(Array::New(isolate, result.data(), result.size()));
260
261
0 commit comments