diff options
author | Roger Dingledine <arma@torproject.org> | 2004-12-07 08:51:10 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-12-07 08:51:10 +0000 |
commit | 5d961c2c066e6ab46c0555947fd027761a31ce67 (patch) | |
tree | 57ca2790b859e24f6aa4d57b60848fab43af2085 | |
parent | a6aa5eebd6117e6af68fd3d685d601ce18f24dbb (diff) | |
download | tor-5d961c2c066e6ab46c0555947fd027761a31ce67.tar.gz tor-5d961c2c066e6ab46c0555947fd027761a31ce67.zip |
plug another memory leak
svn:r3104
-rw-r--r-- | src/or/routerlist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 5abca8c149..fccd9f9c7c 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -450,8 +450,11 @@ routerlist_sl_choose_by_bandwidth(smartlist_t *sl) total_bw += this_bw; // log_fn(LOG_INFO,"Recording bw %d for node %s.", this_bw, router->nickname); } - if (!total_bw) + if (!total_bw) { + SMARTLIST_FOREACH(bandwidths, uint32_t*, p, tor_free(p)); + smartlist_free(bandwidths); return smartlist_choose(sl); + } rand_bw = crypto_pseudo_rand_int(total_bw); // log_fn(LOG_INFO,"Total bw %d. Randomly chose %d.", total_bw, rand_bw); tmp = 0; |