1
0
mirror of https://github.com/git/git synced 2024-06-30 22:54:27 +00:00

builtin/credential: clear credential before exit

We never release memory associated with `struct credential`. Fix this
and mark the corresponding test as leak free.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt 2024-05-27 13:46:49 +02:00 committed by Junio C Hamano
parent 49eb597ce0
commit 96c1655095
2 changed files with 4 additions and 0 deletions

View File

@ -39,5 +39,7 @@ int cmd_credential(int argc, const char **argv, const char *prefix UNUSED)
} else {
usage(usage_msg);
}
credential_clear(&c);
return 0;
}

View File

@ -1,6 +1,8 @@
#!/bin/sh
test_description='basic credential helper tests'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-credential.sh