This can happen if we loose track of the nonce and a circuit with it is
repurposed.
Without this, it would lead to a non fatal assert on a control port circuit
event of puporse change.
Related to #41037
Signed-off-by: David Goulet <dgoulet@torproject.org>
o Minor bugfix (conflux):
- Avoid a non fatal assert when describing a conflux circuit on the control
port after being prepped to be freed. Fixes bug 41037; bugfix on 0.4.8.15.
+ - Remove the pending nonce if we realize that the nonce of the unlinked
+ circuit is not tracked anymore. Should avoid the non fatal assert
+ triggered with a control port circuit event.
/* This circuit is part of set that has already been removed previously freed
* by another leg closing. */
if (!unlinked) {
+ /* This circuit is not Conflux related anymore regardless of its purpose so
+ * remove the pending nonce so after this function, the circuit is not
+ * considered conflux with CIRCUIT_IS_CONFLUX(). */
+ tor_free(circ->conflux_pending_nonce);
+ circ->conflux_pending_nonce = NULL;
return;
}