Skip to content

Commit ce1c1a6

Browse files
committed
dns: fix cares memory leak
1 parent 95d9140 commit ce1c1a6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/cares_wrap.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,11 +1473,16 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
14731473
return Just(true);
14741474
};
14751475

1476-
if (add(true, verbatim).IsNothing())
1476+
if (add(true, verbatim).IsNothing()) {
1477+
uv_freeaddrinfo(res);
14771478
return;
1479+
}
1480+
14781481
if (verbatim == false) {
1479-
if (add(false, true).IsNothing())
1482+
if (add(false, true).IsNothing()) {
1483+
uv_freeaddrinfo(res);
14801484
return;
1485+
}
14811486
}
14821487

14831488
// No responses were found to return

0 commit comments

Comments
 (0)