aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-09-11 20:17:24 +0000
committerNick Mathewson <nickm@torproject.org>2007-09-11 20:17:24 +0000
commit749da8e0e97262a71fd62fd1ae28029cbacf46e9 (patch)
tree5951c955ef0c8c5145d8ce99698de865e6793a6b
parent973502d2905ab4119b1c559295cff62504ada97b (diff)
downloadtor-749da8e0e97262a71fd62fd1ae28029cbacf46e9.tar
tor-749da8e0e97262a71fd62fd1ae28029cbacf46e9.tar.gz
r15047@catbus: nickm | 2007-09-11 13:40:54 -0400
Fix a memory leak when reloading v3 authority certificate and keys. svn:r11428
-rw-r--r--src/or/router.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 3420674fe..a21d5cb51 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -299,8 +299,12 @@ init_v3_authority_keys(const char *keydir)
parsed->cache_info.signed_descriptor_len = eos-cert;
cert = NULL;
- /* Free old values! XXXX020 */
-
+ /* Free old values... */
+ if (authority_key_certificate)
+ authority_cert_free(authority_key_certificate);
+ if (authority_signing_key)
+ crypto_free_pk_env(authority_signing_key);
+ /* ...and replace them. */
authority_key_certificate = parsed;
authority_signing_key = signing_key;
parsed = NULL;