diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-18 05:47:34 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-18 05:47:34 +0000 |
commit | ca248222bb31f4350311a63561cbc7a154699e15 (patch) | |
tree | 2a689a1496d5f73734e295dfa30cbcbd7dd2d829 /src/or | |
parent | 9b72e96f95d3048bb1fb83caa03f45b7e6170f93 (diff) | |
download | tor-ca248222bb31f4350311a63561cbc7a154699e15.tar.gz tor-ca248222bb31f4350311a63561cbc7a154699e15.zip |
Backport: Make it possible to call set_onion_key twice without leaking RAM.
svn:r17675
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/router.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c index d684745907..d24c4486f1 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -60,6 +60,8 @@ 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); |