nimble/host: Clear ATT queue on conn_free

We need to free all mbufs enqueued on ATT queue when connection is
freed, otherwise we may leak mbufs.
This commit is contained in:
Andrzej Kaczmarek
2024-10-16 10:48:13 +02:00
parent 1d866e41af
commit bda4b0c67d
+5
View File
@@ -255,6 +255,11 @@ ble_hs_conn_free(struct ble_hs_conn *conn)
os_mbuf_free_chain(OS_MBUF_PKTHDR_TO_MBUF(omp));
}
while ((omp = STAILQ_FIRST(&conn->att_tx_q)) != NULL) {
STAILQ_REMOVE_HEAD(&conn->att_tx_q, omp_next);
os_mbuf_free_chain(OS_MBUF_PKTHDR_TO_MBUF(omp));
}
#if MYNEWT_VAL(BLE_HS_DEBUG)
memset(conn, 0xff, sizeof *conn);
#endif