]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/merge.c: use fixed strings, not "strbuf", fix leak
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 6 Feb 2023 23:07:48 +0000 (00:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 23:34:39 +0000 (15:34 -0800)
commit345e216f63a71ab58f81cf4eae1eb2a458304ca1
tree80a178e3484d63c6be382b4f5d8fc02066a56c73
parent81559612a94636f1efe8268385fe6a4ab182ac19
builtin/merge.c: use fixed strings, not "strbuf", fix leak

Follow-up 465028e0e25 (merge: add missing strbuf_release(),
2021-10-07) and address the "msg" memory leak in this block. We could
free "&msg" before the "goto done" here, but even better is to avoid
allocating it in the first place.

By repeating the "Fast-forward" string here we can avoid using a
"struct strbuf" altogether.

Suggested-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c
t/t6439-merge-co-error-msgs.sh