[or-cvs] r17675: {tor} Backport: Make it possible to call set_onion_key twice witho (tor/branches/tor-0_2_0-patches/src/or)

nickm at seul.org nickm at seul.org
Thu Dec 18 05:47:35 UTC 2008


Author: nickm
Date: 2008-12-18 00:47:34 -0500 (Thu, 18 Dec 2008)
New Revision: 17675

Modified:
   tor/branches/tor-0_2_0-patches/src/or/router.c
Log:
Backport: Make it possible to call set_onion_key twice without leaking RAM.

Modified: tor/branches/tor-0_2_0-patches/src/or/router.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/router.c	2008-12-18 05:47:28 UTC (rev 17674)
+++ tor/branches/tor-0_2_0-patches/src/or/router.c	2008-12-18 05:47:34 UTC (rev 17675)
@@ -60,6 +60,8 @@
 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);



More information about the tor-commits mailing list