sequencer.c: plug leaks in do_pick_commit
authorStefan Beller <sbeller@google.com>
Fri, 1 Jun 2018 20:01:45 +0000 (13:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Jun 2018 02:36:35 +0000 (11:36 +0900)
Going to leave, we additionally free the author and commit message
and make sure to call update_abort_safety_file().

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
index 72b4d8ecae3b07e2259cf05c4a8f4acdb46eae0a..ae6f2c27ec93f0ee662701a9c1d704428b1ef311 100644 (file)
@@ -1772,7 +1772,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 {