| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent efd5e0e commit 7c75539
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1428,6 +1428,7 @@ static void Query(const FunctionCallbackInfo<Value>& args) { | |||
| 1428 | 1428 | ||
| 1429 | 1429 | ||
| 1430 | 1430 | void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { | |
| 1431 | + auto cleanup = OnScopeLeave([&]() { uv_freeaddrinfo(res); }); | ||
| 1431 | 1432 | std::unique_ptr<GetAddrInfoReqWrap> req_wrap { | |
| 1432 | 1433 | static_cast<GetAddrInfoReqWrap*>(req->data)}; | |
| 1433 | 1434 | Environment* env = req_wrap->env(); | |
@@ -1488,8 +1489,6 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { | |||
| 1488 | 1489 | argv[1] = results; | |
| 1489 | 1490 | } | |
| 1490 | 1491 | ||
| 1491 | - uv_freeaddrinfo(res); | ||
| 1492 | - | ||
| 1493 | 1492 | TRACE_EVENT_NESTABLE_ASYNC_END2( | |
| 1494 | 1493 | TRACING_CATEGORY_NODE2(dns, native), "lookup", req_wrap.get(), | |
| 1495 | 1494 | "count", n, "verbatim", verbatim); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments