diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-02 12:48:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-02 12:48:34 -0400 |
commit | 00ffccd9a6d9b7f484c2e421be33aea3975a2879 (patch) | |
tree | c0e01dfadc0a10feb98bbb517715c384ccacab1c /src/or/circuitlist.c | |
parent | e3c143f5214b4a2d37dbb47940eaf2cc2e212f86 (diff) | |
download | tor-00ffccd9a6d9b7f484c2e421be33aea3975a2879.tar.gz tor-00ffccd9a6d9b7f484c2e421be33aea3975a2879.zip |
Another clang analyzer complaint wrt HT_GENERATE
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro
with the result of a product. But that makes any sane analyzer
worry about overflow.
This patch keeps HT_GENERATE having its old semantics, since we
aren't the only project using ht.h. Instead, define a HT_GENERATE2
that takes a reallocarrayfn.
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 35c52362d2..9d72ea1111 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -94,9 +94,9 @@ static HT_HEAD(chan_circid_map, chan_circid_circuit_map_t) chan_circid_map = HT_INITIALIZER(); HT_PROTOTYPE(chan_circid_map, chan_circid_circuit_map_t, node, chan_circid_entry_hash_, chan_circid_entries_eq_) -HT_GENERATE(chan_circid_map, chan_circid_circuit_map_t, node, - chan_circid_entry_hash_, chan_circid_entries_eq_, 0.6, - malloc, realloc, free) +HT_GENERATE2(chan_circid_map, chan_circid_circuit_map_t, node, + chan_circid_entry_hash_, chan_circid_entries_eq_, 0.6, + tor_reallocarray_, tor_free_) /** The most recently returned entry from circuit_get_by_circid_chan; * used to improve performance when many cells arrive in a row from the |