diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-12-18 10:35:25 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-12-18 10:35:25 -0500 |
commit | 4ede2decadca1decb5f6755c6d65a459d4d09c95 (patch) | |
tree | f0ee8367ced38bdda456c1aa40f7acb9adb89413 /src/test/test_connection.c | |
parent | 9b1c491ec602c936ca9d75e1e55bddbb95056fee (diff) | |
download | tor-4ede2decadca1decb5f6755c6d65a459d4d09c95.tar.gz tor-4ede2decadca1decb5f6755c6d65a459d4d09c95.zip |
Fix an unreached null-pointer deref in connection tests
This is CID 1343603
Diffstat (limited to 'src/test/test_connection.c')
-rw-r--r-- | src/test/test_connection.c | 7 |
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 |