summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 9d4c3fdd18..8851fb0d34 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -397,8 +397,10 @@ init_keys(void)
if (!server_mode(options)) {
if (!(prkey = crypto_new_pk_env()))
return -1;
- if (crypto_pk_generate_key(prkey))
+ if (crypto_pk_generate_key(prkey)) {
+ crypto_free_pk_env(prkey);
return -1;
+ }
set_identity_key(prkey);
/* Create a TLS context; default the client nickname to "client". */
if (tor_tls_context_new(get_identity_key(),
@@ -1302,6 +1304,7 @@ router_rebuild_descriptor(int force)
if (extrainfo_dump_to_string(ei->cache_info.signed_descriptor_body, 8192,
ei, get_identity_key()) < 0) {
log_warn(LD_BUG, "Couldn't generate extra-info descriptor.");
+ extrainfo_free(ei);
return -1;
}
ei->cache_info.signed_descriptor_len =