diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-08 23:09:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-08 23:09:26 +0000 |
commit | 272d37deb3ed7e3dc1c713666aaac3b914d3ae33 (patch) | |
tree | 9645df73cbdb0671d94eee0f33c99484422d4343 | |
parent | f27a368265344d5faf2707f3f1c720f2ecdec335 (diff) | |
download | tor-272d37deb3ed7e3dc1c713666aaac3b914d3ae33.tar tor-272d37deb3ed7e3dc1c713666aaac3b914d3ae33.tar.gz |
r17989@catbus: nickm | 2008-02-08 18:09:23 -0500
Fix a new segfault when poisoning a non-present socks request.
svn:r13433
-rw-r--r-- | src/or/connection.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 2dc0a8ae8..4d7474775 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -337,8 +337,10 @@ _connection_free(connection_t *conn) if (CONN_IS_EDGE(conn)) { edge_connection_t *edge_conn = TO_EDGE_CONN(conn); tor_free(edge_conn->chosen_exit_name); - memset(edge_conn->socks_request, 0xcc, sizeof(socks_request_t)); - tor_free(edge_conn->socks_request); + if (edge_conn->socks_request) { + memset(edge_conn->socks_request, 0xcc, sizeof(socks_request_t)); + tor_free(edge_conn->socks_request); + } } if (conn->type == CONN_TYPE_CONTROL) { control_connection_t *control_conn = TO_CONTROL_CONN(conn); |