diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-18 05:40:57 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-18 05:40:57 +0000 |
commit | 1b735e46dd10b519b16d9dc721b4564df570349a (patch) | |
tree | 01e2d1d41131e671662dc51d455e1786ee1e9788 /src/or/router.c | |
parent | cebdf93949c4dc203aca700705dc4032917db96c (diff) | |
download | tor-1b735e46dd10b519b16d9dc721b4564df570349a.tar.gz tor-1b735e46dd10b519b16d9dc721b4564df570349a.zip |
Make it possible to call set_onion_key twice without leaking RAM.
svn:r17673
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c index 8211d68197..cc2043d6a2 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -53,13 +53,15 @@ static authority_cert_t *legacy_key_certificate = NULL; * used by tor-gencert to sign new signing keys and make new key * certificates. */ -/** Replace the current onion key with <b>k</b>. Does not affect lastonionkey; - * to update onionkey correctly, call rotate_onion_key(). +/** Replace the current onion key with <b>k</b>. Does not affect + * lastonionkey; to update lastonionkey correctly, call rotate_onion_key(). */ static void set_onion_key(crypto_pk_env_t *k) { tor_mutex_acquire(key_lock); + if (onionkey) + crypto_free_pk_env(onionkey); onionkey = k; onionkey_set_at = time(NULL); tor_mutex_release(key_lock); |