Skip to content

Commit

Permalink
Only free if not nullptr
Browse files Browse the repository at this point in the history
It's not clear weather it's allowed or not, better be safe.

Signed-off-by: Omar Mohamed <[email protected]>
  • Loading branch information
omar-mohamed-khallaf committed Sep 21, 2024
1 parent a5666ba commit a58d62d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trantor/net/inner/AresResolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void AresResolver::onQueryResult(int status,
// TODO: Handle unknown family?
}
}
ares_freeaddrinfo(result);
}
if (inets_ptr->empty())
{
Expand All @@ -218,7 +219,6 @@ void AresResolver::onQueryResult(int status,
addrItem.first = inets_ptr;
addrItem.second = trantor::Date::date();
}
ares_freeaddrinfo(result);
callback(*inets_ptr);
}

Expand Down

0 comments on commit a58d62d

Please sign in to comment.