X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a8b9ef8c1c68fbb9c89db2d8c12dca38c15e2bfd..bd68c98879ecc8ce9f7f6d3e01bc4ffeb9182b04:/ui-stats.c diff --git a/ui-stats.c b/ui-stats.c index a9c13fd..7272a61 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++; @@ -241,7 +241,7 @@ static struct string_list collect_stats(const struct cgit_period *period) memset(&authors, 0, sizeof(authors)); while ((commit = get_revision(&rev)) != NULL) { add_commit(&authors, commit, period); - free_commit_buffer(commit); + free_commit_buffer(the_repository->parsed_objects, commit); free_commit_list(commit->parents); commit->parents = NULL; } @@ -389,7 +389,7 @@ void cgit_show_stats(void) cgit_print_layout_start(); html("
"); html("stat options"); - html("
"); + html(""); cgit_add_hidden_formfields(1, 0, "stats"); html(""); if (ctx.repo->max_stats > 1) {