Skip to content
Snippets Groups Projects
Commit d769cab3 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Defensive programming: null [pn]_chan,circ_id in circuit_mark_for_close_

Doing this as part of the patch for #9683 to prevent possible bugs
down the line
parent 1a74360c
No related branches found
No related tags found
No related merge requests found
......@@ -1594,6 +1594,7 @@ circuit_mark_for_close_, (circuit_t *circ, int reason, int line,
channel_send_destroy(circ->n_circ_id, circ->n_chan, reason);
}
circuitmux_detach_circuit(circ->n_chan->cmux, circ);
circuit_set_n_circid_chan(circ, 0, NULL);
}
if (! CIRCUIT_IS_ORIGIN(circ)) {
......@@ -1627,6 +1628,7 @@ circuit_mark_for_close_, (circuit_t *circ, int reason, int line,
channel_send_destroy(or_circ->p_circ_id, or_circ->p_chan, reason);
}
circuitmux_detach_circuit(or_circ->p_chan->cmux, circ);
circuit_set_p_circid_chan(or_circ, 0, NULL);
}
} else {
origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment