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

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



commit 1b6f6bfda59989389983602c57ef0028dd736908
Author: Linus Nordberg <linus@xxxxxxxxxxx>
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);



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