aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-10-01 12:01:46 -0500
committerNick Mathewson <nickm@torproject.org>2018-10-01 12:01:51 -0500
commitc4e29001c48f33ea8b0035da65da50ddf15ffa71 (patch)
tree52102aa2248e768d29767ebb27274abf3c247aad
parentb058f64cc002b44e6dd48616ca3163a01c3f3e14 (diff)
downloadtor-c4e29001c48f33ea8b0035da65da50ddf15ffa71.tar.gz
tor-c4e29001c48f33ea8b0035da65da50ddf15ffa71.zip
Fix a bug where we would crash on --version.
Bug not in any released Tor. test-stem would have caught this.
-rw-r--r--src/feature/stats/predict_ports.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/feature/stats/predict_ports.c b/src/feature/stats/predict_ports.c
index 8abf34f50f..ebf4a42468 100644
--- a/src/feature/stats/predict_ports.c
+++ b/src/feature/stats/predict_ports.c
@@ -303,6 +303,8 @@ predicted_ports_init(void)
void
predicted_ports_free_all(void)
{
+ if (!predicted_ports_list)
+ return;
predicted_ports_total_alloc -=
smartlist_len(predicted_ports_list)*sizeof(predicted_port_t);
SMARTLIST_FOREACH(predicted_ports_list, predicted_port_t *,