Skip to content

Commit 706728a

Browse files
Felipe Contrerasgitster
authored andcommitted
sequencer: avoid leaking message buffer when refusing to create an empty commit
We should free objects before leaving. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c8d1351 commit 706728a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sequencer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,10 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
628628
}
629629

630630
allow = allow_empty(opts, commit);
631-
if (allow < 0)
632-
return allow;
631+
if (allow < 0) {
632+
res = allow;
633+
goto leave;
634+
}
633635
if (!opts->no_commit)
634636
res = run_git_commit(defmsg, opts, allow);
635637

0 commit comments

Comments
 (0)