Skip to content

Commit 706728a

Browse files
felipecgitster
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c8d1351 commit 706728a

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
@@ -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)