summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-06-06 08:58:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-06 18:21:28 (GMT)
commit706728a37c53c3d1c3fc38aa9c9842060d03e9cc (patch)
treeae2e36bf8ce8c438d05021a59605ce12051a22d4 /sequencer.c
parentc8d1351deb2ccb8634d5c3dd863dd37d0d8c082c (diff)
downloadgit-706728a37c53c3d1c3fc38aa9c9842060d03e9cc.zip
git-706728a37c53c3d1c3fc38aa9c9842060d03e9cc.tar.gz
git-706728a37c53c3d1c3fc38aa9c9842060d03e9cc.tar.bz2
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>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index b4989ba..f7be7d8 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -628,8 +628,10 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
}
allow = allow_empty(opts, commit);
- if (allow < 0)
- return allow;
+ if (allow < 0) {
+ res = allow;
+ goto leave;
+ }
if (!opts->no_commit)
res = run_git_commit(defmsg, opts, allow);