]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Defensive programming: null [pn]_chan,circ_id in circuit_mark_for_close_
authorNick Mathewson <nickm@torproject.org>
Wed, 12 Mar 2014 14:57:08 +0000 (10:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 14 Mar 2014 15:58:34 +0000 (11:58 -0400)
Doing this as part of the patch for #9683 to prevent possible bugs
down the line

src/or/circuitlist.c

index 0015a680cf705bb81ff61507adb9cc22de95bc47..867a9cd0a37997879f2cdbb20d976b2f53562da4 100644 (file)
@@ -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);