aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-08 23:09:26 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-08 23:09:26 +0000
commit272d37deb3ed7e3dc1c713666aaac3b914d3ae33 (patch)
tree9645df73cbdb0671d94eee0f33c99484422d4343
parentf27a368265344d5faf2707f3f1c720f2ecdec335 (diff)
downloadtor-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.c6
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);