Skip to content

Commit 452202c

Browse files
dschogitster
authored andcommitted
sequencer: stop releasing the strbuf in write_message()
Nothing in the name "write_message()" suggests that the function releases the strbuf passed to it. So let's release the strbuf in the caller instead. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8f8550b commit 452202c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ static int write_message(struct strbuf *msgbuf, const char *filename)
243243
return error_errno(_("Could not lock '%s'"), filename);
244244
if (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)
245245
return error_errno(_("Could not write to %s"), filename);
246-
strbuf_release(msgbuf);
247246
if (commit_lock_file(&msg_file) < 0)
248247
return error(_("Error wrapping up %s."), filename);
249248

@@ -759,6 +758,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
759758
free_commit_list(common);
760759
free_commit_list(remotes);
761760
}
761+
strbuf_release(&msgbuf);
762762

763763
/*
764764
* If the merge was clean or if it failed due to conflict, we write

0 commit comments

Comments
 (0)