]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-stats.c
ui-stats: cast pointer before checking for zero
[ps-cgit] / ui-stats.c
index a9c13fd4c5e930278ce784960fb85f9234dd0a81..8cd9178cea85cc909a20bb74cc435a424f252f85 100644 (file)
@@ -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++;