Przeglądaj źródła

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
Alexander Færøy 6 lat temu
rodzic
commit
d86c45bf5c
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      src/or/directory.c

+ 1 - 0
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. */
   }