]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: handle alloc failure on qc_new_conn() for owned socket
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 12 Dec 2022 10:24:05 +0000 (11:24 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 12 Dec 2022 13:53:55 +0000 (14:53 +0100)
commit4244833c5f645668f5a90c8dc4a324ede93ebd93
treeaf867a7b053c004821f7a4f7dcd6d829a12b46c7
parentdbf6ad470b3206f64254141e7cf80a980261be29
BUG/MINOR: quic: handle alloc failure on qc_new_conn() for owned socket

This patch is the follow up of previous fix :
  BUG/MINOR: quic: properly handle alloc failure in qc_new_conn()

quic_conn owned socket FD is initialized as soon as possible in
qc_new_conn(). This guarantees that we can safely call
quic_conn_release() on allocation failure. This function uses internally
qc_release_fd() to free the socket FD unless it has been initialized to
an invalid FD value.

Without this patch, a segfault will occur if one inner allocation of
qc_new_conn() fails before qc.fd is initialized.

This change is linked to quic-conn owned socket implementation.
This should be backported up to 2.7.
src/quic_conn.c