summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-09-20 20:11:36 +1000
committerEdward Thomson <ethomson@edwardthomson.com>2018-09-22 19:20:10 +1000
commite84914fd30edc6702e368c8ccfc77dc5607c213c (patch)
tree19518aa5371f83bc03acd53c661c74846cc3dab4
parentdf33b43d08f63b0c2b404c5a4b9c17a420232436 (diff)
downloadlibgit2-ethomson/test_leak.tar.gz
online::clone: free url and username before resettingethomson/test_leak
Before resetting the url and username, ensure that we free them in case they were set by environment variables.
-rw-r--r--tests/online/clone.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/online/clone.c b/tests/online/clone.c
index de66238e3..09eff4823 100644
--- a/tests/online/clone.c
+++ b/tests/online/clone.c
@@ -276,6 +276,9 @@ static int cred_failure_cb(
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_user = git__strdup("libgit2test");
@@ -306,6 +309,9 @@ void test_online_clone__cred_callback_called_again_on_auth_failure(void)
{
size_t counter = 0;
+ git__free(_remote_url);
+ git__free(_remote_user);
+
_remote_url = git__strdup("https://github.com/libgit2/non-existent");
_remote_user = git__strdup("libgit2test");