diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-01-16 05:27:19 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-01-16 05:27:19 +0000 |
commit | 4a3b7496f0c47b0d00c9744698eaa237e601b32a (patch) | |
tree | fdefeb3c864306cc52f3e9f5dadb8414f8a99187 /src/or/routerparse.c | |
parent | 24aae484c93b09c7fc735e53874f02a22e4b5b43 (diff) | |
download | tor-4a3b7496f0c47b0d00c9744698eaa237e601b32a.tar tor-4a3b7496f0c47b0d00c9744698eaa237e601b32a.tar.gz |
r17639@catbus: nickm | 2008-01-15 19:09:21 -0500
Fix some hard to trigger but nonetheless real memory leaks spotted by an anonymous contributor. Needs review. Partial backport candidate.
svn:r13147
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 4b0d65219..a7c54f9ff 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -789,7 +789,7 @@ find_dir_signing_key(const char *str, const char *eos) } if (tok->tp != K_DIR_SIGNING_KEY) { log_warn(LD_DIR, "Dir-signing-key token did not parse as expected"); - return NULL; + goto done; } if (tok->key) { @@ -797,10 +797,10 @@ find_dir_signing_key(const char *str, const char *eos) tok->key = NULL; /* steal reference. */ } else { log_warn(LD_DIR, "Dir-signing-key token contained no key"); - return NULL; } - token_free(tok); + done: + if (tok) token_free(tok); return key; } @@ -1090,7 +1090,7 @@ router_parse_entry_from_string(const char *s, const char *end, if (router_get_router_hash(s, digest) < 0) { log_warn(LD_DIR, "Couldn't compute router hash."); - return NULL; + goto err; } { int flags = 0; |