diff options
author | teor <teor2345@gmail.com> | 2017-05-25 12:30:21 +1000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2017-05-25 00:09:40 -0400 |
commit | ec61ae59a5d009a9e80f3bfa9a2aa5f5dfa05551 (patch) | |
tree | 038b36eb10ef855efc3f03cd85cd2e806bee9e0d /src/or/dirserv.c | |
parent | 6e5486b11ac113ab7cf42d167dd5555b5916ddbc (diff) | |
download | tor-ec61ae59a5d009a9e80f3bfa9a2aa5f5dfa05551.tar.gz tor-ec61ae59a5d009a9e80f3bfa9a2aa5f5dfa05551.zip |
Stop leaking keypin-rejected routerinfos on directory authorities
When directory authorities reject a router descriptor due to keypinning,
free the router descriptor rather than leaking the memory.
Fixes bug 22370; bugfix on 0.2.7.2-alpha.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index fedbe51b4c..72441081c4 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -626,7 +626,11 @@ dirserv_add_multiple_descriptors(const char *desc, uint8_t purpose, * passed back to the origin of this descriptor, or NULL if there is no such * message. Use <b>source</b> to produce better log messages. * - * Return the status of the operation + * If <b>ri</b> is not added to the list of server descriptors, free it. + * That means the caller must not access <b>ri</b> after this function + * returns, since it might have been freed. + * + * Return the status of the operation. * * This function is only called when fresh descriptors are posted, not when * we re-load the cache. @@ -699,6 +703,7 @@ dirserv_add_descriptor(routerinfo_t *ri, const char **msg, const char *source) "its key did not match an older RSA/Ed25519 keypair", router_describe(ri), source); *msg = "Looks like your keypair does not match its older value."; + routerinfo_free(ri); return ROUTER_AUTHDIR_REJECTS; } |