diff options
-rw-r--r-- | range-diff.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/range-diff.c b/range-diff.c index a4d7a90dde..a83c386ffc 100644 --- a/range-diff.c +++ b/range-diff.c @@ -135,9 +135,16 @@ static int read_patches(const char *range, struct string_list *list, orig_len = len; len = parse_git_diff_header(&root, &linenr, 0, line, len, size, &patch); - if (len < 0) - die(_("could not parse git header '%.*s'"), - orig_len, line); + if (len < 0) { + error(_("could not parse git header '%.*s'"), + orig_len, line); + free(util); + free(current_filename); + string_list_clear(list, 1); + strbuf_release(&buf); + strbuf_release(&contents); + return -1; + } strbuf_addstr(&buf, " ## "); if (patch.is_new > 0) strbuf_addf(&buf, "%s (new)", patch.new_name); |