Browse Source

Avoid a segfault in routerlist_reset_warnings()

svn:r5464
Nick Mathewson 20 years ago
parent
commit
7de0c33857
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/or/routerlist.c

+ 2 - 0
src/or/routerlist.c

@@ -1376,6 +1376,8 @@ routerlist_reset_warnings(void)
   SMARTLIST_FOREACH(warned_conflicts, char *, cp, tor_free(cp));
   SMARTLIST_FOREACH(warned_conflicts, char *, cp, tor_free(cp));
   smartlist_clear(warned_conflicts); /* now the list is empty. */
   smartlist_clear(warned_conflicts); /* now the list is empty. */
 
 
+  if (!routerstatus_list)
+    routerstatus_list = smartlist_create();
   SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
   SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
                     rs->name_lookup_warned = 0);
                     rs->name_lookup_warned = 0);