From: Alban Gruin <alban.gruin@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Phillip Wood <phillip.wood@dunelm.org.uk>,
Alban Gruin <alban.gruin@gmail.com>
Subject: [PATCH v1 1/1] sequencer: fix a memory leak in sequencer_continue()
Date: Fri, 29 Nov 2019 00:02:03 +0100 [thread overview]
Message-ID: <20191128230203.26058-1-alban.gruin@gmail.com> (raw)
When continuing an interactive rebase after a merge conflict was solved,
if the resolution could not be committed, sequencer_continue() would
return early without releasing its todo list, resulting in a memory
leak. This plugs this leak by jumping to the end of the function, where
the todo list is deallocated.
Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
---
I found this while adding support of rebase.missingCommitCheck to `git
rebase --continue'.
sequencer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 8952cfa89b..64227a71e5 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -4208,8 +4208,10 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
if (is_rebase_i(opts)) {
if ((res = read_populate_todo(r, &todo_list, opts)))
goto release_todo_list;
- if (commit_staged_changes(r, opts, &todo_list))
- return -1;
+ if (commit_staged_changes(r, opts, &todo_list)) {
+ res = -1;
+ goto release_todo_list;
+ }
} else if (!file_exists(get_todo_path(opts)))
return continue_single_pick(r);
else if ((res = read_populate_todo(r, &todo_list, opts)))
--
2.24.0
reply other threads:[~2019-11-28 23:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191128230203.26058-1-alban.gruin@gmail.com \
--to=alban.gruin@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).