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

url: call protocol handler's disconnect in Curl_conn_free #16604

Closed
wants to merge 2 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Mar 7, 2025

For the case when the connection struct is all setup, the protocol handler allocates data in its setup_connection function, but the connection struct is discarded again before used further because a connection reuse is prefered. Then the handler's disconnect function was not previously called, which then would lead to a memory leak.

I added test case 698 that reproduces the leak and the fix.

Reported-by: Philippe Antoine

For the case when the connection struct is all setup, the protocol
handler allocates data in its setup_connection function, but the
connection struct is discarded again before used further because a
connection reuse is prefered. Then the handler's disconnect function was
not previously called, which then would lead to a memory leak.

I added test case 698 that reproduces the leak and the fix.

Reported-by: Philippe Antoine
@bagder bagder requested a review from icing March 7, 2025 08:35
@github-actions github-actions bot added the tests label Mar 7, 2025
@catenacyber
Copy link

Looks cool

@bagder bagder closed this in f4831da Mar 7, 2025
@bagder bagder deleted the bagder/conn-close-disconnect branch March 7, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants