mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Properly refcount client_identity_key
In a2bb0bf we started using a separate client identity key. When we are
in "public server mode" (that means not a bridge) we will use the same
key. Reusing the key without doing the proper refcounting leads to a
segfault on cleanup during shutdown. Fix that.
Also introduce an assert that triggers if our refcount falls below 0.
That should never happen.
This commit is contained in:
@@ -405,6 +405,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);
|
||||
|
||||
Reference in New Issue
Block a user