Skip to content

Commit

Permalink
dns: fix cares memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
theanarkh committed Jul 20, 2022
1 parent 95d9140 commit ce1c1a6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1473,11 +1473,16 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
return Just(true);
};

if (add(true, verbatim).IsNothing())
if (add(true, verbatim).IsNothing()) {
uv_freeaddrinfo(res);
return;
}

if (verbatim == false) {
if (add(false, true).IsNothing())
if (add(false, true).IsNothing()) {
uv_freeaddrinfo(res);
return;
}
}

// No responses were found to return
Expand Down

0 comments on commit ce1c1a6

Please sign in to comment.