Skip to content

Commit f6b9413

Browse files
agrngitster
authored andcommitted
sequencer: fix a memory leak in sequencer_continue()
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit f6b9413

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sequencer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4256,8 +4256,10 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
42564256
if (is_rebase_i(opts)) {
42574257
if ((res = read_populate_todo(r, &todo_list, opts)))
42584258
goto release_todo_list;
4259-
if (commit_staged_changes(r, opts, &todo_list))
4260-
return -1;
4259+
if (commit_staged_changes(r, opts, &todo_list)) {
4260+
res = -1;
4261+
goto release_todo_list;
4262+
}
42614263
} else if (!file_exists(get_todo_path(opts)))
42624264
return continue_single_pick(r);
42634265
else if ((res = read_populate_todo(r, &todo_list, opts)))

0 commit comments

Comments
 (0)