diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-05-29 16:17:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-05-29 16:17:54 -0400 |
commit | 12a2321501753d1872daed2e036db05845ecc416 (patch) | |
tree | 0e87b1609e953899257c943edaeb8bb563a61ddb /src | |
parent | a6e3db5f7241e28641feffadccbfb9e60e936208 (diff) | |
download | tor-12a2321501753d1872daed2e036db05845ecc416.tar.gz tor-12a2321501753d1872daed2e036db05845ecc416.zip |
Another memory leak bytes the dust.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerkeys.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index 91de4db5c2..a76bf99b3a 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -312,12 +312,14 @@ load_ed_keys(const or_options_t *options, time_t now) check_signing_cert = signing_key_cert; use_signing = master_signing_key; } else { + char *fname = options_get_datadir_fname2(options, "keys", "ed25519_signing"); sign = ed_key_init_from_file( - options_get_datadir_fname2(options, "keys", "ed25519_signing"), + fname, INIT_ED_KEY_NEEDCERT| INIT_ED_KEY_INCLUDE_SIGNING_KEY_IN_CERT, LOG_INFO, NULL, 0, 0, CERT_TYPE_ID_SIGNING, &sign_cert); + tor_free(fname); check_signing_cert = sign_cert; use_signing = sign; } @@ -338,10 +340,12 @@ load_ed_keys(const or_options_t *options, time_t now) if (! want_new_signing_key) flags |= INIT_ED_KEY_OMIT_SECRET; + char *fname = options_get_datadir_fname2(options, "keys", "ed25519_master_id"); id = ed_key_init_from_file( - options_get_datadir_fname2(options, "keys", "ed25519_master_id"), + fname, flags, LOG_WARN, NULL, 0, 0, 0, NULL); + tor_free(fname); if (!id) FAIL("Missing identity key"); if (tor_mem_is_zero((char*)id->seckey.seckey, sizeof(id->seckey))) @@ -359,12 +363,13 @@ load_ed_keys(const or_options_t *options, time_t now) INIT_ED_KEY_EXTRA_STRONG| INIT_ED_KEY_NEEDCERT| INIT_ED_KEY_INCLUDE_SIGNING_KEY_IN_CERT); - sign = ed_key_init_from_file( - options_get_datadir_fname2(options, "keys", "ed25519_signing"), + char *fname = options_get_datadir_fname2(options, "keys", "ed25519_signing"); + sign = ed_key_init_from_file(fname, flags, LOG_WARN, sign_signing_key_with_id, now, options->SigningKeyLifetime, CERT_TYPE_ID_SIGNING, &sign_cert); + tor_free(fname); if (!sign) FAIL("Missing signing key"); use_signing = sign; |