aboutsummaryrefslogtreecommitdiff
path: root/ui-snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-snapshot.c')
-rw-r--r--ui-snapshot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 3e38cd5..acae68c 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -308,11 +308,17 @@ void cgit_print_snapshot(const char *head, const char *hex,
if (!prefix)
prefix = xstrdup(cgit_snapshot_prefix(ctx.repo));
+ if (!ctx.cfg.enable_snapshot_prefix && !ctx.repo->snapshot_prefix) {
+ free(prefix);
+ prefix = NULL;
+ }
+
if (sig_filename)
write_sig(f, hex, filename, sig_filename);
else
make_snapshot(f, hex, prefix, filename);
- free(prefix);
+ if (prefix)
+ free(prefix);
free(adj_filename);
}