summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-01 04:40:12 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-01 04:40:12 +0000
commit6d49465b691046efb0ffa2c7e89898cdd35ee192 (patch)
tree3c8c1ae617ebea5623089048a549e451761e7314 /src
parentc1b4bfdeac40e49224f64b80890251df7177ce43 (diff)
downloadtor-6d49465b691046efb0ffa2c7e89898cdd35ee192.tar.gz
tor-6d49465b691046efb0ffa2c7e89898cdd35ee192.zip
fix two trivial potential onionkey leaks. neither of these
should happen in practice. but now they really won't. svn:r12620
Diffstat (limited to 'src')
-rw-r--r--src/or/router.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index c1e8b0c92c..2cf762f650 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -189,6 +189,8 @@ rotate_onion_key(void)
goto done;
error:
log_warn(LD_GENERAL, "Couldn't rotate onion key.");
+ if (prkey)
+ crypto_free_pk_env(prkey);
done:
tor_free(fname);
tor_free(fname_prev);
@@ -469,7 +471,7 @@ init_keys(void)
}
keydir = get_datadir_fname2("keys", "secret_onion_key.old");
- if (file_status(keydir) == FN_FILE) {
+ if (!lastonionkey && file_status(keydir) == FN_FILE) {
prkey = init_key_from_file(keydir, 1, LOG_ERR);
if (prkey)
lastonionkey = prkey;