about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui-stats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui-stats.c b/ui-stats.c
index a9c13fd..8cd9178 100644
--- a/ui-stats.c
+++ b/ui-stats.c
@@ -184,9 +184,9 @@ static void add_commit(struct string_list *authors, struct commit *commit,
 	period->trunc(date);
 	tmp = xstrdup(period->pretty(date));
 	item = string_list_insert(items, tmp);
-	if (item->util)
-		free(tmp);
 	counter = (uintptr_t *)&item->util;
+	if (*counter)
+		free(tmp);
 	(*counter)++;
 
 	authorstat->total++;