diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2021-05-19 16:37:58 -0400 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2021-05-19 17:22:13 -0400 |
commit | d064c5976d02b552dd549751a929ba2691a4ad8d (patch) | |
tree | 5e98ac41cee0d99229e8729408c42b30caa3e69a /src/plugins/quic | |
parent | 46b8b1a4c0743ef91d41db6dea582eb590f5f31b (diff) |
quic: fix memory leak & crash on connection delete
- quicly conn struct leaked on connection delete
- Occasionally connection delete is called twice
before connection is closed which caused a crash.
Type: fix
Change-Id: Ifaaaeda55f71d58c97fa4d6652bda60a3efd4b69
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/plugins/quic')
-rw-r--r-- | src/plugins/quic/quic.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c index 4ca42b9fdfc..6bdc17d7abf 100644 --- a/src/plugins/quic/quic.c +++ b/src/plugins/quic/quic.c @@ -572,6 +572,12 @@ quic_connection_delete (quic_ctx_t * ctx) clib_bihash_kv_16_8_t kv; quicly_conn_t *conn; + if (ctx->conn == NULL) + { + QUIC_DBG (2, "Skipping redundant delete of connection %u", + ctx->c_c_index); + return; + } QUIC_DBG (2, "Deleting connection %u", ctx->c_c_index); QUIC_ASSERT (!quic_ctx_is_stream (ctx)); @@ -587,8 +593,8 @@ quic_connection_delete (quic_ctx_t * ctx) quic_disconnect_transport (ctx); - if (ctx->conn) - quicly_free (ctx->conn); + if (conn) + quicly_free (conn); session_transport_delete_notify (&ctx->connection); } |