summaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-08-05 19:07:33 -0400
committerNick Mathewson <nickm@torproject.org>2011-08-05 19:07:33 -0400
commit413574ad388d1f5bb756e818beb5ea9837b03bc3 (patch)
tree5ad6bae13207f89d3c94395756b151f4d48b6450 /src/or/buffers.c
parente511a3a4dd4cacd8d2cd4f076ea321f75e5dfd22 (diff)
downloadtor-413574ad388d1f5bb756e818beb5ea9837b03bc3.tar.gz
tor-413574ad388d1f5bb756e818beb5ea9837b03bc3.zip
Clear socks auth fields before free
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 5b9e55ebd5..488289c06d 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1532,8 +1532,14 @@ socks_request_free(socks_request_t *req)
{
if (!req)
return;
- tor_free(req->username);
- tor_free(req->password);
+ if (req->username) {
+ memset(req->username, 0x10, req->usernamelen);
+ tor_free(req->username);
+ }
+ if (req->password) {
+ memset(req->password, 0x04, req->passwordlen);
+ tor_free(req->password);
+ }
memset(req, 0xCC, sizeof(socks_request_t));
tor_free(req);
}