mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Fix two more coverity-spotted leaks in master.
One is a probably-impossible leak if we fail to sign a consensus; another occurs when we can't look up the user we're trying to chown our sockets to.
This commit is contained in:
parent
f3835bcb37
commit
99457ee776
@ -1068,6 +1068,7 @@ connection_listener_new(const struct sockaddr *listensockaddr,
|
|||||||
log_warn(LD_NET,"Unable to chown() %s socket: user %s not found.",
|
log_warn(LD_NET,"Unable to chown() %s socket: user %s not found.",
|
||||||
address, options->User);
|
address, options->User);
|
||||||
tor_close_socket(s);
|
tor_close_socket(s);
|
||||||
|
goto err;
|
||||||
} else if (chown(address, pw->pw_uid, pw->pw_gid) < 0) {
|
} else if (chown(address, pw->pw_uid, pw->pw_gid) < 0) {
|
||||||
log_warn(LD_NET,"Unable to chown() %s socket: %s.",
|
log_warn(LD_NET,"Unable to chown() %s socket: %s.",
|
||||||
address, strerror(errno));
|
address, strerror(errno));
|
||||||
|
@ -2121,7 +2121,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
|||||||
digest, digest_len,
|
digest, digest_len,
|
||||||
signing_key)) {
|
signing_key)) {
|
||||||
log_warn(LD_BUG, "Couldn't sign consensus networkstatus.");
|
log_warn(LD_BUG, "Couldn't sign consensus networkstatus.");
|
||||||
return NULL; /* This leaks, but it should never happen. */
|
goto done;
|
||||||
}
|
}
|
||||||
smartlist_add(chunks, tor_strdup(sigbuf));
|
smartlist_add(chunks, tor_strdup(sigbuf));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user