File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -610,7 +610,7 @@ static int run_am(struct rebase_options *opts)
610
610
status = error_errno (_ ("could not open '%s' for writing" ),
611
611
rebased_patches );
612
612
free (rebased_patches );
613
- strvec_clear (& am . args );
613
+ child_process_clear (& am );
614
614
return status ;
615
615
}
616
616
@@ -638,7 +638,7 @@ static int run_am(struct rebase_options *opts)
638
638
struct reset_head_opts ropts = { 0 };
639
639
unlink (rebased_patches );
640
640
free (rebased_patches );
641
- strvec_clear (& am . args );
641
+ child_process_clear (& am );
642
642
643
643
ropts .oid = & opts -> orig_head -> object .oid ;
644
644
ropts .branch = opts -> head_name ;
@@ -659,7 +659,7 @@ static int run_am(struct rebase_options *opts)
659
659
status = error_errno (_ ("could not open '%s' for reading" ),
660
660
rebased_patches );
661
661
free (rebased_patches );
662
- strvec_clear (& am . args );
662
+ child_process_clear (& am );
663
663
return status ;
664
664
}
665
665
Original file line number Diff line number Diff line change @@ -58,4 +58,13 @@ test_expect_success 'unknown key in author-script' '
58
58
check_resolve_fails
59
59
'
60
60
61
+ test_expect_success POSIXPERM,SANITY ' unwritable rebased-patches does not leak' '
62
+ >.git/rebased-patches &&
63
+ chmod a-w .git/rebased-patches &&
64
+
65
+ git checkout -b side HEAD^ &&
66
+ test_commit unrelated &&
67
+ test_must_fail git rebase --apply --onto tmp HEAD^
68
+ '
69
+
61
70
test_done
You can’t perform that action at this time.
0 commit comments