Diff options
-rw-r--r--source/ui-log.c4
-rw-r--r--source/ui-patch.c1
-rw-r--r--source/ui-shared.h2
-rw-r--r--source/ui-stats.c1
4 files changed, 4 insertions, 4 deletions
diff --git a/source/ui-log.c b/source/ui-log.c
index ef52951..5b3a88a 100644
--- a/source/ui-log.c
+++ b/source/ui-log.c
@@ -612,8 +612,10 @@ void cgit_print_log(const char *tip, int ofs, int cnt, const char *grep, const c
html("</tbody>\n");
}
-out:
+ // The mailmap is cgit's own and outlives the walk.
+ rev.mailmap = NULL;
release_revisions(&rev);
+out:
if (must_free_tip)
free((char *)tip);
strvec_clear(&rev_argv);
diff --git a/source/ui-patch.c b/source/ui-patch.c
index 3c76255..0fa9a2e 100644
--- a/source/ui-patch.c
+++ b/source/ui-patch.c
@@ -74,7 +74,6 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, const char *pref
rev.max_count = ctx.cfg.max_patch_count;
// The headers wait until the walk has started.
if (cgit_prepare_walk(&rev)) {
- release_revisions(&rev);
strvec_clear(&rev_argv);
return;
}
diff --git a/source/ui-shared.h b/source/ui-shared.h
index 32337d9..cd937a3 100644
--- a/source/ui-shared.h
+++ b/source/ui-shared.h
@@ -158,7 +158,7 @@ extern int cgit_get_old_oid(const char *old_rev, const struct commit *commit, st
/*
* Start rev's walk, or print the error page and return non-zero when git
* cannot. A failed setup leaves the walk holding freed commits, so the caller
- * must not read from it then.
+ * must then neither read from it nor hand it to release_revisions.
*/
extern int cgit_prepare_walk(struct rev_info *rev);
diff --git a/source/ui-stats.c b/source/ui-stats.c
index f3ad25e..ee5b76b 100644
--- a/source/ui-stats.c
+++ b/source/ui-stats.c
@@ -218,7 +218,6 @@ static int collect_stats(const struct cgit_period *period, struct string_list *a
// bounds the period edge exactly.
rev.max_age = since;
if (cgit_prepare_walk(&rev)) {
- release_revisions(&rev);
strvec_clear(&argv);
return -1;
}