Commit 54c02f26 by Edward Thomson Committed by Patrick Steinhardt

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.

(cherry picked from commit e84914fd)
parent 27469ed3
...@@ -263,6 +263,9 @@ static int cred_failure_cb( ...@@ -263,6 +263,9 @@ static int cred_failure_cb(
void test_online_clone__cred_callback_failure_return_code_is_tunnelled(void) void test_online_clone__cred_callback_failure_return_code_is_tunnelled(void)
{ {
git__free(_remote_url);
git__free(_remote_user);
_remote_url = git__strdup("https://github.com/libgit2/non-existent"); _remote_url = git__strdup("https://github.com/libgit2/non-existent");
_remote_user = git__strdup("libgit2test"); _remote_user = git__strdup("libgit2test");
...@@ -293,6 +296,9 @@ void test_online_clone__cred_callback_called_again_on_auth_failure(void) ...@@ -293,6 +296,9 @@ void test_online_clone__cred_callback_called_again_on_auth_failure(void)
{ {
size_t counter = 0; size_t counter = 0;
git__free(_remote_url);
git__free(_remote_user);
_remote_url = git__strdup("https://github.com/libgit2/non-existent"); _remote_url = git__strdup("https://github.com/libgit2/non-existent");
_remote_user = git__strdup("libgit2test"); _remote_user = git__strdup("libgit2test");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment