Don't try to generate stats from an empty served_descs.

This commit is contained in:
Linus Nordberg 2012-03-27 15:00:34 +02:00
parent 77bc1b803e
commit 1b6f6bfda5

View File

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