Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e84914f

Browse files
committed
online::clone: free url and username before resetting
Before resetting the url and username, ensure that we free them in case they were set by environment variables.
1 parent df33b43 commit e84914f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)