summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-13 10:36:06 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-13 10:39:56 -0400
commit2bfd92d0d170642fb12f53e5da208f318fdd632c (patch)
tree09da23f22e58e196fef9995e21b59aff3b555487 /src/or/dirserv.c
parent5da821a8a3cfffc18f5a656852d98e69cff5dd8f (diff)
downloadtor-2bfd92d0d170642fb12f53e5da208f318fdd632c.tar.gz
tor-2bfd92d0d170642fb12f53e5da208f318fdd632c.zip
Apply coccinelle script to replace malloc(a*b)->calloc(a,b)
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index f72f19f025..f33437ff52 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1537,18 +1537,18 @@ dirserv_compute_performance_thresholds(routerlist_t *rl,
* sort them and use that to compute thresholds. */
n_active = n_active_nonexit = 0;
/* Uptime for every active router. */
- uptimes = tor_malloc(sizeof(uint32_t)*smartlist_len(rl->routers));
+ uptimes = tor_calloc(sizeof(uint32_t), smartlist_len(rl->routers));
/* Bandwidth for every active router. */
- bandwidths_kb = tor_malloc(sizeof(uint32_t)*smartlist_len(rl->routers));
+ bandwidths_kb = tor_calloc(sizeof(uint32_t), smartlist_len(rl->routers));
/* Bandwidth for every active non-exit router. */
bandwidths_excluding_exits_kb =
- tor_malloc(sizeof(uint32_t)*smartlist_len(rl->routers));
+ tor_calloc(sizeof(uint32_t), smartlist_len(rl->routers));
/* Weighted mean time between failure for each active router. */
- mtbfs = tor_malloc(sizeof(double)*smartlist_len(rl->routers));
+ mtbfs = tor_calloc(sizeof(double), smartlist_len(rl->routers));
/* Time-known for each active router. */
- tks = tor_malloc(sizeof(long)*smartlist_len(rl->routers));
+ tks = tor_calloc(sizeof(long), smartlist_len(rl->routers));
/* Weighted fractional uptime for each active router. */
- wfus = tor_malloc(sizeof(double)*smartlist_len(rl->routers));
+ wfus = tor_calloc(sizeof(double), smartlist_len(rl->routers));
nodelist_assert_ok();