summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/test_connection.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index dab6f2bbb6..c5ef92931d 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -182,14 +182,13 @@ test_conn_get_basic_teardown(const struct testcase_t *tc, void *arg)
conn->linked_conn->write_event = NULL;
}
- connection_free(conn->linked_conn);
- conn->linked_conn = NULL;
-
- conn->linked_conn->linked_conn = NULL;
if (!conn->linked_conn->marked_for_close) {
connection_close_immediate(conn->linked_conn);
connection_mark_for_close(conn->linked_conn);
}
+ conn->linked_conn->linked_conn = NULL;
+ connection_free(conn->linked_conn);
+ conn->linked_conn = NULL;
}
/* We didn't set the events up properly, so we can't use event_del() in