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 3bc0497 commit ecfca31Copy full SHA for ecfca31
src/node_os.cc
@@ -192,6 +192,9 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
192
return args.GetReturnValue().SetUndefined();
193
}
194
195
+ auto cleanup =
196
+ OnScopeLeave([&]() { uv_free_interface_addresses(interfaces, count); });
197
+
198
Local<Value> no_scope_id = Integer::New(isolate, -1);
199
std::vector<Local<Value>> result;
200
result.reserve(count * 7);
@@ -243,7 +246,6 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
243
246
244
247
245
248
- uv_free_interface_addresses(interfaces, count);
249
args.GetReturnValue().Set(Array::New(isolate, result.data(), result.size()));
250
251
0 commit comments