diff options
-rw-r--r-- | src/common/crypto.c | 1 | ||||
-rw-r--r-- | src/or/router.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index c723c33dd0..a444cf126a 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -326,6 +326,7 @@ crypto_free_pk_env(crypto_pk_env_t *env) if (--env->refs > 0) return; + tor_assert(env->refs == 0); if (env->key) RSA_free(env->key); diff --git a/src/or/router.c b/src/or/router.c index 96aca88376..c471599cb6 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -559,7 +559,7 @@ init_keys(void) * otherwise, set the server identity key as our client identity * key. */ if (public_server_mode(options)) { - set_client_identity_key(prkey); /* set above */ + set_client_identity_key(crypto_pk_dup_key(prkey)); /* set above */ } else { if (!(prkey = crypto_new_pk_env())) return -1; |