summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-06-29 12:31:17 -0400
committerNick Mathewson <nickm@torproject.org>2011-06-29 13:08:46 -0400
commit2e6604f42ee614156ceeb29bdcab5c78cc1d84ba (patch)
tree47cf86914ee90bf09bbc56a78366ee9edde013db /src/or/connection.c
parent204bce7e3ca0f60cfec1d8be700848309f605abd (diff)
downloadtor-2e6604f42ee614156ceeb29bdcab5c78cc1d84ba.tar.gz
tor-2e6604f42ee614156ceeb29bdcab5c78cc1d84ba.zip
Record username/password data in socks_request_t
This change also requires us to add and use a pair of allocator/deallocator functions for socks_request_t, instead of using tor_malloc_zero/tor_free directly.
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 6f9ae20a78..2a4a6f7626 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -246,7 +246,7 @@ edge_connection_new(int type, int socket_family)
tor_assert(type == CONN_TYPE_EXIT || type == CONN_TYPE_AP);
connection_init(time(NULL), TO_CONN(edge_conn), type, socket_family);
if (type == CONN_TYPE_AP)
- edge_conn->socks_request = tor_malloc_zero(sizeof(socks_request_t));
+ edge_conn->socks_request = socks_request_new();
return edge_conn;
}
@@ -440,10 +440,8 @@ _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);
- if (edge_conn->socks_request) {
- memset(edge_conn->socks_request, 0xcc, sizeof(socks_request_t));
- tor_free(edge_conn->socks_request);
- }
+ if (edge_conn->socks_request)
+ socks_request_free(edge_conn->socks_request);
rend_data_free(edge_conn->rend_data);
}