mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
dns: fix parse memory leaky
PR-URL: https://github.com/nodejs/node/pull/58973 Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
921b563999
commit
3afb15b715
1 file changed
+2
-2
+2
-2
@@ -1565,6 +1565,8 @@ Maybe<int> SoaTraits::Parse(QuerySoaWrap* wrap,
|
||||
|
||||
if (status != ARES_SUCCESS) return Just<int>(status);
|
||||
|
||||
auto cleanup = OnScopeLeave([&]() { ares_free_data(soa_out); });
|
||||
|
||||
Local<Object> soa_record = Object::New(env->isolate());
|
||||
|
||||
if (soa_record
|
||||
@@ -1605,8 +1607,6 @@ Maybe<int> SoaTraits::Parse(QuerySoaWrap* wrap,
|
||||
return Nothing<int>();
|
||||
}
|
||||
|
||||
ares_free_data(soa_out);
|
||||
|
||||
wrap->CallOnComplete(soa_record);
|
||||
return Just<int>(ARES_SUCCESS);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user