Skip to content

fix memory leak in ares_send#511

Merged
bradh352 merged 1 commit intoc-ares:mainfrom
createyourpersonalaccount:ares_send-memleak
Feb 10, 2023
Merged

fix memory leak in ares_send#511
bradh352 merged 1 commit intoc-ares:mainfrom
createyourpersonalaccount:ares_send-memleak

Conversation

@createyourpersonalaccount
Copy link
Copy Markdown
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