diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-10-26 18:22:04 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-10-26 18:22:04 +0200 |
commit | 213139f887edd5f366108e72d77c33bcfa3f8ba9 (patch) | |
tree | c53f0737feb427c77cedfca2d8b66f48cea11425 /src/or/router.c | |
parent | 441241c13692051ff1b4ae86eaf472a8782cd5d6 (diff) | |
download | tor-213139f887edd5f366108e72d77c33bcfa3f8ba9.tar.gz tor-213139f887edd5f366108e72d77c33bcfa3f8ba9.zip |
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.
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c index 3fd7b7fc39..725a515e0c 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -573,7 +573,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; |