[tor-commits] [tor/master] Don't try to generate stats from an empty served_descs.

nickm at torproject.org nickm at torproject.org
Fri Mar 30 14:09:11 UTC 2012


commit 1b6f6bfda59989389983602c57ef0028dd736908
Author: Linus Nordberg <linus at nordberg.se>
Date:   Tue Mar 27 15:00:34 2012 +0200

    Don't try to generate stats from an empty served_descs.
---
 src/or/rephist.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/or/rephist.c b/src/or/rephist.c
index 3d5000c..0cd60ee 100644
--- a/src/or/rephist.c
+++ b/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);





More information about the tor-commits mailing list