aboutsummaryrefslogtreecommitdiff
path: root/src/util/socks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/socks.c')
-rw-r--r--src/util/socks.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/util/socks.c b/src/util/socks.c
index ece79b3e4..4a790ac94 100644
--- a/src/util/socks.c
+++ b/src/util/socks.c
@@ -596,15 +596,17 @@ GNUNET_SOCKS_do_connect (const char *service_name,
596 service_name,port1,host1); 596 service_name,port1,host1);
597 return NULL; 597 return NULL;
598 } 598 }
599 /* Appeared to still work after host0 corrupted, so either test case is broken, or
600 this whole routine is not being called. */
599 if (GNUNET_OK != 601 if (GNUNET_OK !=
600 GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSHOST", &host0)) 602 GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSHOST", &host0))
601 host0 = NULL; /* you don't want to feed a static string to free(), right? */ 603 host0 = NULL;
602 socks5 = GNUNET_CONNECTION_create_from_connect (cfg, (char*)(host0 || "127.0.0.1"), port0); 604 socks5 = GNUNET_CONNECTION_create_from_connect (cfg, (host0 != NULL)? host0:"127.0.0.1", port0);
603 if (host0) GNUNET_free (host0); 605 if (host0) GNUNET_free (host0);
604 606
605 /* Sets to NULL if they do not exist */ 607 /* Sets to NULL if they do not exist */
606 GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSUSER", &user); 608 (void)GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSUSER", &user);
607 GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSPASS", &pass); 609 (void)GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSPASS", &pass);
608 ih = GNUNET_SOCKS_init_handshake(user,pass); 610 ih = GNUNET_SOCKS_init_handshake(user,pass);
609 if (NULL != user) GNUNET_free (user); 611 if (NULL != user) GNUNET_free (user);
610 if (NULL != pass) GNUNET_free (pass); 612 if (NULL != pass) GNUNET_free (pass);