summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-10-12 13:51:45 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-10-12 13:51:45 -0700
commit6aa501aab2668edcd3989dfe6f1cffb82552212c (patch)
tree939b58359562052edf7a3ced580119bcaabeea52
parentMerge branch 'ab/reverse-midx-optim' into maint (diff)
parentrange-diff: avoid segfault with -I (diff)
downloadtgif-6aa501aab2668edcd3989dfe6f1cffb82552212c.tar.xz
Merge branch 'rs/range-diff-avoid-segfault-with-I' into maint
"git range-diff -I... <range> <range>" segfaulted, which has been corrected. * rs/range-diff-avoid-segfault-with-I: range-diff: avoid segfault with -I
-rw-r--r--range-diff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/range-diff.c b/range-diff.c
index e731525e66..cac89a2f4f 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -482,6 +482,7 @@ static void output(struct string_list *a, struct string_list *b,
else
diff_setup(&opts);
+ opts.no_free = 1;
if (!opts.output_format)
opts.output_format = DIFF_FORMAT_PATCH;
opts.flags.suppress_diff_headers = 1;
@@ -542,6 +543,8 @@ static void output(struct string_list *a, struct string_list *b,
strbuf_release(&buf);
strbuf_release(&dashes);
strbuf_release(&indent);
+ opts.no_free = 0;
+ diff_free(&opts);
}
int show_range_diff(const char *range1, const char *range2,