mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Fix memory leak in frac_nodes_with_descriptors().
This patch fixes a memory leak in frac_nodes_with_descriptors() where we might return without free'ing the bandwidths variable. See: Coverity CID 1437451.
This commit is contained in:
parent
1724f995c7
commit
dcbfee246f
@ -2765,6 +2765,8 @@ frac_nodes_with_descriptors(const smartlist_t *sl,
|
||||
if (node_has_descriptor(node))
|
||||
n_with_descs++;
|
||||
});
|
||||
|
||||
tor_free(bandwidths);
|
||||
return ((double)n_with_descs) / (double)smartlist_len(sl);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user