Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory leak in ares_send #511

Merged
merged 1 commit into from
Feb 10, 2023
Merged

fix memory leak in ares_send #511

merged 1 commit into from
Feb 10, 2023

Conversation

createyourpersonalaccount
Copy link
Contributor

When the condition channel->nservers < 1 holds, the function returns prematurely, without deallocating query->tcpbuf. We rearrange the check to be done prior to the allocations, avoiding the memory leak. In this way, we also avoid unnecessary allocations if channel->nservers < 1 holds.

When the condition channel->nservers < 1 holds, the function returns
prematurely, without deallocating query->tcpbuf. We rearrange the
check to be done prior to the allocations, avoiding the memory
leak. In this way, we also avoid unnecessary allocations if
channel->nservers < 1 holds.
@bradh352 bradh352 merged commit 38b30bc into c-ares:main Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants