Backport: Make it possible to call set_onion_key twice without leaking RAM.
svn:r17675
This commit is contained in:
parent
9b72e96f95
commit
ca248222bb
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue