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)
610610 status = error_errno (_ ("could not open '%s' for writing" ),
611611 rebased_patches );
612612 free (rebased_patches );
613- strvec_clear (& am . args );
613+ child_process_clear (& am );
614614 return status ;
615615 }
616616
@@ -638,7 +638,7 @@ static int run_am(struct rebase_options *opts)
638638 struct reset_head_opts ropts = { 0 };
639639 unlink (rebased_patches );
640640 free (rebased_patches );
641- strvec_clear (& am . args );
641+ child_process_clear (& am );
642642
643643 ropts .oid = & opts -> orig_head -> object .oid ;
644644 ropts .branch = opts -> head_name ;
@@ -659,7 +659,7 @@ static int run_am(struct rebase_options *opts)
659659 status = error_errno (_ ("could not open '%s' for reading" ),
660660 rebased_patches );
661661 free (rebased_patches );
662- strvec_clear (& am . args );
662+ child_process_clear (& am );
663663 return status ;
664664 }
665665
Original file line number Diff line number Diff line change @@ -58,4 +58,13 @@ test_expect_success 'unknown key in author-script' '
5858 check_resolve_fails
5959'
6060
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+
6170test_done
You can’t perform that action at this time.
0 commit comments