git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] sequencer.c: free author variable when merging fails

From
Stefan Beller <sbeller@google.com>
Date
May 30, 2018, 17:03 UTC
Message-ID
<20180530170302.191176-2-sbeller@google.com>
In-Reply-To
<20180530170302.191176-1-sbeller@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---

This was a deliberate oversight in f241ff0d0a9 (prepare the builtins for a libified merge_recursive(), 2016-07-26)

 sequencer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sequencer.c b/sequencer.c
index 72b4d8ecae3..5c93586cc1c 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1771,8 +1771,10 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
 	else if (!opts->strategy || !strcmp(opts->strategy, "recursive") || command == TODO_REVERT) {
 		res = do_recursive_merge(base, next, base_label, next_label,
 					 &head, &msgbuf, opts);
-		if (res < 0)
+		if (res < 0) {
+			free(author);
 			return res;
+		}
 		res |= write_message(msgbuf.buf, msgbuf.len,
 				     git_path_merge_msg(), 0);
 	} else {
-- 
2.17.1.1185.g55be947832-goog
Previous: Stefan BellerNext: Johannes Schindelin
Message 2 of 11 in “refs/packed-backend.c: close fd of empty file”
  1. 1/3 refs/packed-backend.c: close fd of empty fileStefan Beller, May 30, 2018
  2. 2/3 sequencer.c: free author variable when merging failsStefan Beller, May 30, 2018
  3. Johannes SchindelinMay 31, 2018
  4. Stefan BellerMay 31, 2018
  5. 3/3 submodule--helper: plug mem leak in print_default_remoteStefan Beller, May 30, 2018
  6. Johannes SchindelinMay 31, 2018
  7. Stefan BellerMay 31, 2018
  8. Johannes SchindelinJun 1, 2018
  9. Jeff KingMay 31, 2018
  10. Michael HaggertyMay 31, 2018
  11. Johannes SchindelinMay 31, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.