From 05d4ae64365cd0c49de165d8fca78178a74e21c2 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 13 Apr 2022 17:40:26 +0200 Subject: [PATCH] BUG/MINOR: quic: fix return value for error in start Fix the return value used in quic-conn start callback for error. The caller expects a negative value in this case. Without this patch, the quic-conn and the connection stack are not closed despite an initialization failure error, which is an undefined behavior and may cause a crash in the end. --- src/xprt_quic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 6ab18d871..528f7c010 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -5756,7 +5756,7 @@ static int qc_xprt_start(struct connection *conn, void *ctx) qc = conn->handle.qc; if (qcc_install_app_ops(qc->qcc, qc->app_ops)) { TRACE_PROTO("Cannot install app layer", QUIC_EV_CONN_LPKT, qc); - return 0; + return -1; } /* mux-quic can now be considered ready. */