diff options
author | Alexander Færøy <ahf@torproject.org> | 2018-06-23 10:33:40 +0200 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2018-06-23 10:33:40 +0200 |
commit | d86c45bf5cc75a526b884a754d72ef4d11aa0693 (patch) | |
tree | 04241f8b3388b80c8637fab02f8d7ffc6debf9ce | |
parent | dc2384da30cae716f512dedef37d27f00c43f29d (diff) | |
download | tor-d86c45bf5cc75a526b884a754d72ef4d11aa0693.tar.gz tor-d86c45bf5cc75a526b884a754d72ef4d11aa0693.zip |
Fix memory leak in client_likes_consensus().
This patches fixes a memory leak in client_likes_consensus() where if
consensus_cache_entry_get_voter_id_digests() would fail we would return
without having free'd the voters list.
See: Coverity CID 1437447
-rw-r--r-- | src/or/directory.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 5ceea2fb32..f52354356d 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3499,6 +3499,7 @@ client_likes_consensus(const struct consensus_cache_entry_t *ent, int have = 0; if (consensus_cache_entry_get_voter_id_digests(ent, voters) != 0) { + smartlist_free(voters); return 1; // We don't know the voters; assume the client won't mind. */ } |