Browse Source

Merge remote-tracking branch 'linus/empty_desc_stats'

Nick Mathewson 12 years ago
parent
commit
545cb5f34e
2 changed files with 6 additions and 0 deletions
  1. 4 0
      changes/bug5508
  2. 2 0
      src/or/rephist.c

+ 4 - 0
changes/bug5508

@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Fix a bug where a bridge authority crashes (on a failed assert)
+      if it has seen no directory requests when it's time to write
+      statistics to disk.

+ 2 - 0
src/or/rephist.c

@@ -2657,6 +2657,8 @@ rep_hist_format_desc_stats(time_t now)
     return NULL;
 
   size =  digestmap_size(served_descs);
+  if (size == 0)
+    return NULL;
   vals = tor_malloc(size * sizeof(int));
 
   for (iter = digestmap_iter_init(served_descs); !digestmap_iter_done(iter);