[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix a bug where we would crash on --version.



commit c4e29001c48f33ea8b0035da65da50ddf15ffa71
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Mon Oct 1 12:01:46 2018 -0500

    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(+)

diff --git a/src/feature/stats/predict_ports.c b/src/feature/stats/predict_ports.c
index 8abf34f50..ebf4a4246 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 *,

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits