From 4ede2decadca1decb5f6755c6d65a459d4d09c95 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 18 Dec 2015 10:35:25 -0500 Subject: Fix an unreached null-pointer deref in connection tests This is CID 1343603 --- src/test/test_connection.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/test') 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 -- cgit v1.2.3-54-g00ecf