From 39f6f6aa2cdfc7e0dba3aa9e8e830378d1666294 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 6 Feb 2024 10:16:09 +0100 Subject: [PATCH] cleanup: optimize connection freeing --- htp/htp_connection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htp/htp_connection.c b/htp/htp_connection.c index 358df9b2..e7f8362a 100644 --- a/htp/htp_connection.c +++ b/htp/htp_connection.c @@ -81,6 +81,9 @@ void htp_conn_destroy(htp_conn_t *conn) { for (size_t i = 0, n = htp_list_size(conn->transactions); i < n; i++) { htp_tx_t *tx = htp_list_get(conn->transactions, i); if (tx != NULL) { + // nullify conn so as not to call htp_conn_remove_tx + // since we remove all txs + tx->conn = NULL; htp_tx_destroy_incomplete(tx); } }