]> git.ipfire.org Git - thirdparty/git.git/commit
tag: use a "goto cleanup" pattern, leak less memory
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 20 Oct 2021 18:27:19 +0000 (20:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Oct 2021 18:36:13 +0000 (11:36 -0700)
commit37766b61cdb3e12709febcd2f9dbee2b90e62969
treef8a8d1ebd8f2dabe4e120d3359c11444bfbc143a
parent9d530dc0024503ab4218fe6c4395b8a0aa245478
tag: use a "goto cleanup" pattern, leak less memory

Change cmd_tag() to free its "struct strbuf"'s instead of using an
UNLEAK() pattern. This changes code added in 886e1084d78 (builtin/:
add UNLEAKs, 2017-10-01).

As shown in the context of the declaration of the "struct
msg_arg" (which I'm changing to use a designated initializer while at
it, and to show the context in this change), that struct is just a
thin wrapper around an int and "struct strbuf".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/tag.c