Skip to content

Commit 603f2f5

Browse files
avargitster
authored andcommitted
revert: fix parse_options_concat() leak
Free memory from parse_options_concat(), which comes from code originally added (then extended) in [1]. At this point we could get several more tests leak-free by free()-ing the xstrdup() just above the line being changed, but that one's trickier than it seems. The sequencer_remove_state() function supposedly owns it, but sometimes we don't call it. I have a fix for it, but it's non-trivial, so let's fix the easy one first. 1. c62f6ec (revert: add --ff option to allow fast forward when cherry-picking, 2010-03-06) Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent d1ec656 commit 603f2f5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

builtin/revert.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
221221
opts->strategy = xstrdup_or_null(opts->strategy);
222222
if (!opts->strategy && getenv("GIT_TEST_MERGE_ALGORITHM"))
223223
opts->strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
224+
free(options);
224225

225226
if (cmd == 'q') {
226227
int ret = sequencer_remove_state(opts);

t/t3429-rebase-edit-todo.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='rebase should reread the todo file if an exec modifies it'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67
. "$TEST_DIRECTORY"/lib-rebase.sh
78

0 commit comments

Comments
 (0)