summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-07 15:20:50 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-07 15:20:50 -0500
commitba7d93db16fd53c951b6a159adeb7b4094817c11 (patch)
treeabe4ab2c73650426d9c8cbb4ffb7bf4efcd1b3b9 /src/or/connection.c
parent0061d428900946ce8bf5c8bfb4c2b3b5faa4f691 (diff)
parentd3aabf4db176a44d19046b58b99f2edb8c5f49bb (diff)
downloadtor-ba7d93db16fd53c951b6a159adeb7b4094817c11.tar.gz
tor-ba7d93db16fd53c951b6a159adeb7b4094817c11.zip
Merge remote-tracking branch 'public/bug7816_023'
Conflicts: src/common/util.c
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 0d8242a54e..d0602fde24 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1058,6 +1058,7 @@ connection_listener_new(const struct sockaddr *listensockaddr,
if (bind(s, listensockaddr, (socklen_t)sizeof(struct sockaddr_un)) == -1) {
log_warn(LD_NET,"Bind to %s failed: %s.", address,
tor_socket_strerror(tor_socket_errno(s)));
+ tor_close_socket(s);
goto err;
}
#ifdef HAVE_PWD_H
@@ -1066,9 +1067,11 @@ connection_listener_new(const struct sockaddr *listensockaddr,
if (pw == NULL) {
log_warn(LD_NET,"Unable to chown() %s socket: user %s not found.",
address, options->User);
+ tor_close_socket(s);
} else if (chown(address, pw->pw_uid, pw->pw_gid) < 0) {
log_warn(LD_NET,"Unable to chown() %s socket: %s.",
address, strerror(errno));
+ tor_close_socket(s);
goto err;
}
}
@@ -1707,6 +1710,7 @@ connection_read_https_proxy_response(connection_t *conn)
tor_free(headers);
return -1;
}
+ tor_free(headers);
if (!reason) reason = tor_strdup("[no reason given]");
if (status_code == 200) {