aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_pt.c
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2014-04-14 21:51:34 +0000
committerYawning Angel <yawning@schwanenlied.me>2014-05-21 08:14:38 +0000
commit7a18ac7454f16a2ac592312e041f9bb9f30cae31 (patch)
tree6be6df6376acc26da717c73160f33d9f76065e64 /src/test/test_pt.c
parent41d2b4d3af01b34beb2951028cdbc45b5f41e08e (diff)
downloadtor-7a18ac7454f16a2ac592312e041f9bb9f30cae31.tar.gz
tor-7a18ac7454f16a2ac592312e041f9bb9f30cae31.zip
Fixed the test build with --enable-gcc-warnings
Diffstat (limited to 'src/test/test_pt.c')
-rw-r--r--src/test/test_pt.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index 788d4205cc..cfbd084226 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -464,7 +464,7 @@ test_get_pt_proxy_uri(void *arg)
tt_assert(uri == NULL);
/* Test with a SOCKS4 proxy. */
- options->Socks4Proxy = "192.0.2.1:1080";
+ options->Socks4Proxy = tor_strdup("192.0.2.1:1080");
ret = tor_addr_port_lookup(options->Socks4Proxy,
&options->Socks4ProxyAddr,
&options->Socks4ProxyPort);
@@ -472,11 +472,10 @@ test_get_pt_proxy_uri(void *arg)
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "socks4a://192.0.2.1:1080");
tor_free(uri);
-
- options->Socks4Proxy = NULL;
+ tor_free(options->Socks4Proxy);
/* Test with a SOCKS5 proxy, no username/password. */
- options->Socks5Proxy = "192.0.2.1:1080";
+ options->Socks5Proxy = tor_strdup("192.0.2.1:1080");
ret = tor_addr_port_lookup(options->Socks5Proxy,
&options->Socks5ProxyAddr,
&options->Socks5ProxyPort);
@@ -486,16 +485,17 @@ test_get_pt_proxy_uri(void *arg)
tor_free(uri);
/* Test with a SOCKS5 proxy, with username/password. */
- options->Socks5ProxyUsername = "hwest";
- options->Socks5ProxyPassword = "r34n1m470r";
+ options->Socks5ProxyUsername = tor_strdup("hwest");
+ options->Socks5ProxyPassword = tor_strdup("r34n1m470r");
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "socks5://hwest:r34n1m470r@192.0.2.1:1080");
tor_free(uri);
-
- options->Socks5Proxy = NULL;
+ tor_free(options->Socks5Proxy);
+ tor_free(options->Socks5ProxyUsername);
+ tor_free(options->Socks5ProxyPassword);
/* Test with a HTTPS proxy, no authenticator. */
- options->HTTPSProxy = "192.0.2.1:80";
+ options->HTTPSProxy = tor_strdup("192.0.2.1:80");
ret = tor_addr_port_lookup(options->HTTPSProxy,
&options->HTTPSProxyAddr,
&options->HTTPSProxyPort);
@@ -505,15 +505,15 @@ test_get_pt_proxy_uri(void *arg)
tor_free(uri);
/* Test with a HTTPS proxy, with authenticator. */
- options->HTTPSProxyAuthenticator = "hwest:r34n1m470r";
+ options->HTTPSProxyAuthenticator = tor_strdup("hwest:r34n1m470r");
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "http://hwest:r34n1m470r@192.0.2.1:80");
tor_free(uri);
-
- options->HTTPSProxy = NULL;
+ tor_free(options->HTTPSProxy);
+ tor_free(options->HTTPSProxyAuthenticator);
/* Token nod to the fact that IPv6 exists. */
- options->Socks4Proxy = "[2001:db8::1]:1080";
+ options->Socks4Proxy = tor_strdup("[2001:db8::1]:1080");
ret = tor_addr_port_lookup(options->Socks4Proxy,
&options->Socks4ProxyAddr,
&options->Socks4ProxyPort);
@@ -521,7 +521,7 @@ test_get_pt_proxy_uri(void *arg)
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "socks4a://[2001:db8::1]:1080");
tor_free(uri);
-
+ tor_free(options->Socks4Proxy);
done:
if (uri)