diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-06-19 09:03:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-06-19 09:03:34 -0400 |
commit | 1edaef2adfe7c929f4fb2bfa1c3519e3f28297ce (patch) | |
tree | bdc35159314e05145ff039e94b22200515700212 /src/or/routerkeys.c | |
parent | 583a387c1ea855c0b063f14c382b2cedcdc3dc08 (diff) | |
download | tor-1edaef2adfe7c929f4fb2bfa1c3519e3f28297ce.tar.gz tor-1edaef2adfe7c929f4fb2bfa1c3519e3f28297ce.zip |
fix some memory leaks that coverity found
Diffstat (limited to 'src/or/routerkeys.c')
-rw-r--r-- | src/or/routerkeys.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index f5cae44f5b..2fd7f41a8d 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -29,10 +29,11 @@ read_encrypted_secret_key(ed25519_secret_key_t *out, sizeof(encrypted_key)); if (encrypted_len < 0) { log_info(LD_OR, "%s is missing", fname); - return 0; + r = 0; + goto done; } if (strcmp(tag, ENC_KEY_TAG)) - return -1; + goto done; while (1) { ssize_t pwlen = @@ -64,6 +65,7 @@ read_encrypted_secret_key(ed25519_secret_key_t *out, done: memwipe(encrypted_key, 0, encrypted_len); memwipe(pwbuf, 0, sizeof(pwbuf)); + tor_free(tag); if (secret) { memwipe(secret, 0, secret_len); tor_free(secret); @@ -498,6 +500,7 @@ load_ed_keys(const or_options_t *options, time_t now) tor_free(fname); goto err; } + tor_free(fname); fname = options_get_datadir_fname2(options, "keys", "ed25519_master_id"); id = ed_key_init_from_file( fname, |