]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix two more coverity-spotted leaks in master.
authorNick Mathewson <nickm@torproject.org>
Mon, 11 Feb 2013 22:01:02 +0000 (17:01 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 11 Feb 2013 22:01:02 +0000 (17:01 -0500)
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.

src/or/connection.c
src/or/dirvote.c

index 7b0f081fdebba5efec1dce618fac8a5d9c18f828..737da72923033001d2f19111097029d5e3dd849e 100644 (file)
@@ -1068,6 +1068,7 @@ connection_listener_new(const struct sockaddr *listensockaddr,
         log_warn(LD_NET,"Unable to chown() %s socket: user %s not found.",
                  address, options->User);
         tor_close_socket(s);
+        goto err;
       } else if (chown(address, pw->pw_uid, pw->pw_gid) < 0) {
         log_warn(LD_NET,"Unable to chown() %s socket: %s.",
                  address, strerror(errno));
index 66dc50debe3471a83a16823b9de720f450548f4a..358708b6c58df197bbe503efb2d4966f1d39a6c2 100644 (file)
@@ -2121,7 +2121,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
                                        digest, digest_len,
                                        signing_key)) {
       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));