summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index c2a7a87d41..25c75ff101 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -634,6 +634,10 @@ connection_free_(connection_t *conn)
cached_dir_decref(dir_conn->cached_dir);
rend_data_free(dir_conn->rend_data);
+ if (dir_conn->guard_state) {
+ /* Cancel before freeing, if it's still there. */
+ entry_guard_cancel(get_guard_selection_info(), &dir_conn->guard_state);
+ }
circuit_guard_state_free(dir_conn->guard_state);
}