builtin/tag: fix leaking key ID on failure to sign
We do not free the key ID when signing a tag fails. Do so by using the common exit path. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
1a99173de0
commit
d06e3ec858
@ -164,7 +164,7 @@ static int do_sign(struct strbuf *buffer, struct object_id **compat_oid,
|
||||
int ret = -1;
|
||||
|
||||
if (sign_buffer(buffer, &sig, keyid))
|
||||
return -1;
|
||||
goto out;
|
||||
|
||||
if (compat) {
|
||||
const struct git_hash_algo *algo = the_repository->hash_algo;
|
||||
|
@ -10,6 +10,7 @@ Tests for operations with tags.'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-gpg.sh
|
||||
. "$TEST_DIRECTORY"/lib-terminal.sh
|
||||
|
Reference in New Issue
Block a user