Skip to content

Commit b3e6ef9

Browse files
authored
Merge pull request libgit2#4816 from libgit2/ethomson/test_leak
online::clone: free url and username before resetting
2 parents a54043b + e84914f commit b3e6ef9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/online/clone.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ static int cred_failure_cb(
276276

277277
void test_online_clone__cred_callback_failure_return_code_is_tunnelled(void)
278278
{
279+
git__free(_remote_url);
280+
git__free(_remote_user);
281+
279282
_remote_url = git__strdup("https://github.com/libgit2/non-existent");
280283
_remote_user = git__strdup("libgit2test");
281284

@@ -306,6 +309,9 @@ void test_online_clone__cred_callback_called_again_on_auth_failure(void)
306309
{
307310
size_t counter = 0;
308311

312+
git__free(_remote_url);
313+
git__free(_remote_user);
314+
309315
_remote_url = git__strdup("https://github.com/libgit2/non-existent");
310316
_remote_user = git__strdup("libgit2test");
311317

0 commit comments

Comments
 (0)