mirror of
https://github.com/git/git
synced 2024-09-13 13:24:41 +00:00
builtin/merge.c: free "&buf" on "Your local changes..." error
Plug a memory leak introduced in [1], since that change didn't follow the "goto done" pattern introduced in [2] we'd leak the "&buf" memory. 1.e4cdfe84a0
(merge: abort if index does not match HEAD for trivial merges, 2022-07-23) 2.d5a35c114a
(Copy resolve_ref() return value for longer use, 2011-11-13) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
345e216f63
commit
41211db10f
|
@ -1618,7 +1618,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
|||
error(_("Your local changes to the following files would be overwritten by merge:\n %s"),
|
||||
sb.buf);
|
||||
strbuf_release(&sb);
|
||||
return 2;
|
||||
ret = 2;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* See if it is really trivial. */
|
||||
|
|
Loading…
Reference in a new issue