diff --git a/src/quic_conn.c b/src/quic_conn.c index 5b04dbfc1..5feda3b3e 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -1448,8 +1448,10 @@ int quic_conn_release(struct quic_conn *qc) } /* Substract last congestion window from global memory counter. */ - cshared_add(&quic_mem_diff, -qc->path->cwnd); - qc->path->cwnd = 0; + if (qc->path) { + cshared_add(&quic_mem_diff, -qc->path->cwnd); + qc->path->cwnd = 0; + } /* free remaining stream descriptors */ node = eb64_first(&qc->streams_by_id);