diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-07 23:20:13 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-07 23:20:13 -0400 |
commit | f0bce2dc359dc2b3004af33541b27c495ad731f3 (patch) | |
tree | 78165f9661418243e4669dafffa737923f88c570 /src/or | |
parent | 595303fd1e1998e12c51901f1aea77311e973a44 (diff) | |
download | tor-f0bce2dc359dc2b3004af33541b27c495ad731f3.tar.gz tor-f0bce2dc359dc2b3004af33541b27c495ad731f3.zip |
Fix some harmless/untriggerable memory leaks found by coverity
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/dirserv.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index b6c5dd41f4..f5994e0318 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2578,14 +2578,6 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, tor_assert(private_key); tor_assert(cert); - if (resolve_my_address(LOG_WARN, options, &addr, NULL, &hostname)<0) { - log_warn(LD_NET, "Couldn't resolve my hostname"); - return NULL; - } - if (!hostname || !strchr(hostname, '.')) { - tor_free(hostname); - hostname = tor_dup_ip(addr); - } if (crypto_pk_get_digest(private_key, signing_key_digest)<0) { log_err(LD_BUG, "Error computing signing key digest"); return NULL; @@ -2594,6 +2586,14 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, log_err(LD_BUG, "Error computing identity key digest"); return NULL; } + if (resolve_my_address(LOG_WARN, options, &addr, NULL, &hostname)<0) { + log_warn(LD_NET, "Couldn't resolve my hostname"); + return NULL; + } + if (!hostname || !strchr(hostname, '.')) { + tor_free(hostname); + hostname = tor_dup_ip(addr); + } if (options->VersioningAuthoritativeDir) { client_versions = format_versions_list(options->RecommendedClientVersions); |