diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2024-04-18 15:14:05 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-18 22:33:41 +0200 |
commit | 42aae6a49af1be6108c3133af881cb9429aa3d35 (patch) | |
tree | c93e8499ec47ab5a0c979ad328f4bc6844c1929d /sequencer.c | |
parent | Merge branch 'pw/t3428-cleanup' into pw/rebase-m-signoff-fix (diff) | |
download | git-42aae6a49af1be6108c3133af881cb9429aa3d35.tar.xz git-42aae6a49af1be6108c3133af881cb9429aa3d35.zip |
sequencer: always free "struct replay_opts"
sequencer_post_commit_cleanup() initializes an instance of "struct
replay_opts" but does not call replay_opts_release(). Currently this
does not leak memory because the code paths called don't allocate any of
the struct members. That will change in the next commit so add call to
replay_opts_release() to prevent a memory leak in "git commit" that
breaks all of the leak free tests.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c index f49a871ac0..e4146b4cdf 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2823,12 +2823,14 @@ void sequencer_post_commit_cleanup(struct repository *r, int verbose) NULL, REF_NO_DEREF); if (!need_cleanup) - return; + goto out; if (!have_finished_the_last_pick()) - return; + goto out; sequencer_remove_state(&opts); +out: + replay_opts_release(&opts); } static void todo_list_write_total_nr(struct todo_list *todo_list) |