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

[tor-commits] [tor/master] Fix an assertion failure introduced by #25948



commit bbf0b92b1c03e1d5e132aebd4e2a06c9d78557af
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue May 1 10:47:44 2018 -0400

    Fix an assertion failure introduced by #25948
    
    Apparently, we can decide our state is dirty before we create the
    event to tell the mainloop that we should save it.  That's not a
    problem, except for the assertion failure.
---
 src/or/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/or/main.c b/src/or/main.c
index 1160f377e..b5ddfe6f2 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2022,7 +2022,10 @@ save_state_callback(time_t now, const or_options_t *options)
 void
 reschedule_or_state_save(void)
 {
-  tor_assert(save_state_event);
+  if (save_state_event == NULL) {
+    /* This can happen early on during startup. */
+    return;
+  }
   periodic_event_reschedule(save_state_event);
 }
 

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