summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-06-25 13:22:41 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-06-25 13:22:41 -0700
commit02f27d0dd0a9695fa8337c3ddd97a2b5ad0aec73 (patch)
treecc19ad364df8e03d5d9861520e1c50448a2b98a1 /sequencer.c
parentMerge branch 'cc/tests-without-assuming-ref-files-backend' (diff)
parentsequencer.c: plug mem leak in git_sequencer_config (diff)
downloadtgif-02f27d0dd0a9695fa8337c3ddd97a2b5ad0aec73.tar.xz
Merge branch 'sb/plug-misc-leaks'
Misc leak plugging. * sb/plug-misc-leaks: sequencer.c: plug mem leak in git_sequencer_config sequencer.c: plug leaks in do_pick_commit submodule--helper: plug mem leak in print_default_remote refs/packed-backend.c: close fd of empty file
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index ee1f7b2df7..5354d4d51e 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -176,6 +176,7 @@ static int git_sequencer_config(const char *k, const char *v, void *cb)
warning(_("invalid commit message cleanup mode '%s'"),
s);
+ free((char *)s);
return status;
}
@@ -1774,7 +1775,8 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
res = do_recursive_merge(base, next, base_label, next_label,
&head, &msgbuf, opts);
if (res < 0)
- return res;
+ goto leave;
+
res |= write_message(msgbuf.buf, msgbuf.len,
git_path_merge_msg(), 0);
} else {