]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix memory leak in client_likes_consensus().
authorAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 08:33:40 +0000 (10:33 +0200)
committerAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 08:33:40 +0000 (10:33 +0200)
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

src/or/directory.c

index 5ceea2fb3226b0d99430441d2c6b71ec573eafa3..f52354356d802700d5319f03d06d549a7a4652ff 100644 (file)
@@ -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. */
   }