Skip to content

Commit 1d615af

Browse files
pks-tgitster
authored andcommitted
builtin/credential-store: fix leaking credential
We never free credentials read by the credential store, leading to a memory leak. Plug it. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 11d6a81 commit 1d615af

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

builtin/credential-store.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,5 +218,6 @@ int cmd_credential_store(int argc, const char **argv, const char *prefix)
218218
; /* Ignore unknown operation. */
219219

220220
string_list_clear(&fns, 0);
221+
credential_clear(&c);
221222
return 0;
222223
}

t/t0302-credential-store.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

33
test_description='credential-store tests'
4+
5+
TEST_PASSES_SANITIZE_LEAK=true
46
. ./test-lib.sh
57
. "$TEST_DIRECTORY"/lib-credential.sh
68

t/t0303-credential-external.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ you can set GIT_TEST_CREDENTIAL_HELPER_SETUP to a sequence of shell
2929
commands.
3030
'
3131

32+
TEST_PASSES_SANITIZE_LEAK=true
3233
. ./test-lib.sh
3334
. "$TEST_DIRECTORY"/lib-credential.sh
3435

0 commit comments

Comments
 (0)