aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-07-15 09:06:53 +0000
committerChristian Grothoff <christian@grothoff.org>2011-07-15 09:06:53 +0000
commitf92c24a77fe00db9547cffa5e3d7defc3d831292 (patch)
tree86ff79def6594c6822ed5e1c253db7086731c8fc /src/util
parent4b5f756c88898e7c3449807d420358d3a2ee8c0c (diff)
downloadgnunet-f92c24a77fe00db9547cffa5e3d7defc3d831292.tar.gz
gnunet-f92c24a77fe00db9547cffa5e3d7defc3d831292.zip
leakfix
Diffstat (limited to 'src/util')
-rw-r--r--src/util/client.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/util/client.c b/src/util/client.c
index 629e8c872..e17797042 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -275,11 +275,12 @@ do_connect (const char *service_name,
275 if (0 == (attempt % 2)) 275 if (0 == (attempt % 2))
276 { 276 {
277 /* on even rounds, try UNIX */ 277 /* on even rounds, try UNIX */
278 if ((GNUNET_OK == 278 unixpath = NULL;
279 GNUNET_CONFIGURATION_get_value_string (cfg, 279 if ( (GNUNET_OK ==
280 service_name, 280 GNUNET_CONFIGURATION_get_value_string (cfg,
281 "UNIXPATH", &unixpath)) && 281 service_name,
282 (0 < strlen (unixpath))) /* We have a non-NULL unixpath, does that mean it's valid? */ 282 "UNIXPATH", &unixpath)) &&
283 (0 < strlen (unixpath)) ) /* We have a non-NULL unixpath, does that mean it's valid? */
283 { 284 {
284 sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, unixpath); 285 sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, unixpath);
285 if (sock != NULL) 286 if (sock != NULL)
@@ -325,21 +326,23 @@ do_connect (const char *service_name,
325 if (0 != (attempt % 2)) 326 if (0 != (attempt % 2))
326 { 327 {
327 /* try UNIX */ 328 /* try UNIX */
328 if ((GNUNET_OK == 329 unixpath = NULL;
329 GNUNET_CONFIGURATION_get_value_string (cfg, 330 if ( (GNUNET_OK ==
330 service_name, 331 GNUNET_CONFIGURATION_get_value_string (cfg,
331 "UNIXPATH", &unixpath)) && 332 service_name,
332 (0 < strlen (unixpath))) 333 "UNIXPATH", &unixpath)) &&
334 (0 < strlen (unixpath)))
333 { 335 {
334 sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, 336 sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg,
335 unixpath); 337 unixpath);
336 GNUNET_free (unixpath);
337 if (sock != NULL) 338 if (sock != NULL)
338 { 339 {
340 GNUNET_free (unixpath);
339 GNUNET_free (hostname); 341 GNUNET_free (hostname);
340 return sock; 342 return sock;
341 } 343 }
342 } 344 }
345 GNUNET_free_non_null (unixpath);
343 } 346 }
344#endif 347#endif
345#if DEBUG_CLIENT 348#if DEBUG_CLIENT