Skip to content

connection pool: never discard a connection still in use - #23189

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:cpool-never-discard-in-use
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:cpool-never-discard-in-use

Conversation

@icing

@icing icing commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Discarding a connection still in use by transfers is a programming error, regardless if the connection has been aborted or not.

Deny that unconditionally to not risk use-after-free issues and add a DEBUGASSERT() to catch this mistake.

reported-by: Joshua Rogers

Discarding a connection still in use by transfers is a programming
error, regardless if the connection has been aborted or not.

Deny that unconditionally to not risk use-after-free issues and
add a DEBUGASSERT() to catch this mistake.

reported-by: Joshua Rogers
Comment thread lib/conncache.c Resolved
@jay jay closed this in 146698e Oct 1, 2026
@jay

jay commented Oct 1, 2026

Copy link
Copy Markdown
Member

Thanks

dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Nov 18, 2026
Discarding a connection still in use by transfers is a programming
error, regardless if the connection has been aborted or not.

Deny that unconditionally to not risk use-after-free issues and
add a DEBUGASSERT() to catch this mistake.

reported-by: Joshua Rogers

Closes curl#23189

Backport notes:

- Drift in cpool_discard_conn(): the release traces on the transfer.

(cherry picked from commit 146698e)
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.

2 participants