diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-02-25 15:47:36 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-25 15:47:36 -0800 |
commit | 362f869ff2dbc389234ecd8c4b996a9e507c39d7 (patch) | |
tree | 077586c50787e0a4469311aa15e7059f731825c5 /add-interactive.c | |
parent | Merge branch 'ab/date-mode-release' (diff) | |
parent | diff.[ch]: have diff_free() free options->parseopts (diff) | |
download | tgif-362f869ff2dbc389234ecd8c4b996a9e507c39d7.tar.xz |
Merge branch 'ab/diff-free-more'
Leakfixes.
* ab/diff-free-more:
diff.[ch]: have diff_free() free options->parseopts
diff.[ch]: have diff_free() call clear_pathspec(opts.pathspec)
Diffstat (limited to 'add-interactive.c')
-rw-r--r-- | add-interactive.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/add-interactive.c b/add-interactive.c index 6498ae196f..e1ab39cce3 100644 --- a/add-interactive.c +++ b/add-interactive.c @@ -797,14 +797,14 @@ static int run_revert(struct add_i_state *s, const struct pathspec *ps, diffopt.flags.override_submodule_config = 1; diffopt.repo = s->r; - if (do_diff_cache(&oid, &diffopt)) + if (do_diff_cache(&oid, &diffopt)) { + diff_free(&diffopt); res = -1; - else { + } else { diffcore_std(&diffopt); diff_flush(&diffopt); } free(paths); - clear_pathspec(&diffopt.pathspec); if (!res && write_locked_index(s->r->index, &index_lock, COMMIT_LOCK) < 0) |