aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index c61f3117b..5fb4ac183 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -112,8 +112,6 @@ connection_t *connection_or_connect(routerinfo_t *router) {
/* set up conn so it's got all the data we need to remember */
connection_or_init_conn_from_router(conn, router);
- /* XXXX Should all this stuff do mark-for-close instead? */
-
if(connection_add(conn) < 0) { /* no space, forget it */
connection_free(conn);
return NULL;
@@ -121,8 +119,7 @@ connection_t *connection_or_connect(routerinfo_t *router) {
switch(connection_connect(conn, router->address, router->addr, router->or_port)) {
case -1:
- connection_remove(conn);
- connection_free(conn);
+ connection_mark_for_close(conn, 0);
return NULL;
case 0:
connection_set_poll_socket(conn);
@@ -140,8 +137,7 @@ connection_t *connection_or_connect(routerinfo_t *router) {
return conn;
/* failure */
- connection_remove(conn);
- connection_free(conn);
+ connection_mark_for_close(conn, 0);
return NULL;
}