aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2015-08-29 17:00:51 +0200
committerSebastian Hahn <sebastian@torproject.org>2015-09-01 15:10:10 +0200
commitbbb73eaf31d3df5cde70ac4ca7145ffca053d53e (patch)
tree7d77e187d8dd52e69a3d177455047c4462af5d01 /src/or/channel.c
parentb531fc7d9a8f75969b0446578ee4afcb109bae3d (diff)
downloadtor-bbb73eaf31d3df5cde70ac4ca7145ffca053d53e.tar.gz
tor-bbb73eaf31d3df5cde70ac4ca7145ffca053d53e.zip
properly delete current channel in channel_free_list
channel_unregister() removes channels from the current smartlist while we're in a SMORTLIST_FOREACH loop. This only works by accident.
Diffstat (limited to 'src/or/channel.c')
-rw-r--r--src/or/channel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index af095026e4..21522a5303 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -3069,6 +3069,7 @@ channel_free_list(smartlist_t *channels, int mark_for_close)
if (curr->cmux) {
circuitmux_detach_all_circuits(curr->cmux, NULL);
}
+ SMARTLIST_DEL_CURRENT(channels, curr);
channel_unregister(curr);
if (mark_for_close) {
if (!CHANNEL_CONDEMNED(curr)) {