aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-25 16:04:30 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-25 16:04:30 -0400
commitfb4a82c485b694e080a1d86dde7be2ddbf512bc4 (patch)
tree5d85ef557200c108bb4c33cae0aa727e73e418be
parentde54e143123ff37e2e1db09391ca32096b059b67 (diff)
downloadtor-fb4a82c485b694e080a1d86dde7be2ddbf512bc4.tar.gz
tor-fb4a82c485b694e080a1d86dde7be2ddbf512bc4.zip
circuit: Keep a copy of n_circ_id for logging
Prior to the log statement, the circuit n_circ_id value is zeroed so keep a copy so we can log it at the end. Part of #23645 Signed-off-by: David Goulet <dgoulet@torproject.org>
-rw-r--r--src/or/circuitlist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 7fbf6e4488..65fcdaaddb 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -926,12 +926,16 @@ circuit_clear_testing_cell_stats(circuit_t *circ)
STATIC void
circuit_free(circuit_t *circ)
{
+ circid_t n_circ_id = 0;
void *mem;
size_t memlen;
int should_free = 1;
if (!circ)
return;
+ /* We keep a copy of this so we can log its value before it gets unset. */
+ n_circ_id = circ->n_circ_id;
+
circuit_clear_testing_cell_stats(circ);
if (CIRCUIT_IS_ORIGIN(circ)) {
@@ -1028,7 +1032,7 @@ circuit_free(circuit_t *circ)
cell_queue_clear(&circ->n_chan_cells);
log_info(LD_CIRC, "Circuit %u (id: %" PRIu32 ") has been freed.",
- circ->n_circ_id,
+ n_circ_id,
CIRCUIT_IS_ORIGIN(circ) ?
TO_ORIGIN_CIRCUIT(circ)->global_identifier : 0);