From c4e29001c48f33ea8b0035da65da50ddf15ffa71 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 1 Oct 2018 12:01:46 -0500 Subject: Fix a bug where we would crash on --version. Bug not in any released Tor. test-stem would have caught this. --- src/feature/stats/predict_ports.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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 *, -- cgit v1.2.3-54-g00ecf