- fix use of uninitialized memory
[oweals/gnunet.git] / src / arm / test_arm_api.c
index a36d5939bafd4e381ec18414ae95b09eaf4ff9b7..33ab11f05a1446ae38ef9fb43ac571958668bca0 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file arm/test_arm_api.c
@@ -43,9 +43,9 @@ static int ok = 1;
 static int phase = 0;
 
 static void
-arm_stop_cb (void *cls, 
-            enum GNUNET_ARM_RequestStatus status, 
-            const char *servicename, 
+arm_stop_cb (void *cls,
+            enum GNUNET_ARM_RequestStatus status,
+            const char *servicename,
             enum GNUNET_ARM_Result result)
 {
   /* (6), a stop request should be sent to ARM successfully */
@@ -59,8 +59,8 @@ arm_stop_cb (void *cls,
 
 
 static void
-resolver_stop_cb (void *cls, 
-                 enum GNUNET_ARM_RequestStatus status, 
+resolver_stop_cb (void *cls,
+                 enum GNUNET_ARM_RequestStatus status,
                  const char *servicename, enum GNUNET_ARM_Result result)
 {
   /* (5), a stop request should be sent to ARM successfully.
@@ -104,9 +104,9 @@ dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen)
 
 
 static void
-resolver_start_cb (void *cls, 
-                  enum GNUNET_ARM_RequestStatus status, 
-                  const char *servicename, 
+resolver_start_cb (void *cls,
+                  enum GNUNET_ARM_RequestStatus status,
+                  const char *servicename,
                   enum GNUNET_ARM_Result result)
 {
   /* (2), the start request for resolver should be sent successfully
@@ -129,7 +129,7 @@ trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 
 static void
-arm_conn (void *cls, 
+arm_conn (void *cls,
          int connected)
 {
   if (GNUNET_SYSERR == connected)
@@ -163,9 +163,9 @@ arm_conn (void *cls,
 
 
 static void
-arm_start_cb (void *cls, 
-             enum GNUNET_ARM_RequestStatus status, 
-             const char *servicename, 
+arm_start_cb (void *cls,
+             enum GNUNET_ARM_RequestStatus status,
+             const char *servicename,
              enum GNUNET_ARM_Result result)
 {
   /* (0) The request should be "sent" successfully
@@ -185,21 +185,7 @@ static void
 task (void *cls, char *const *args, const char *cfgfile,
       const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  char *armconfig;
   cfg = c;
-  if (NULL != cfgfile)
-  {
-    if (GNUNET_OK !=
-        GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG",
-                                              &armconfig))
-    {
-      GNUNET_CONFIGURATION_set_value_string ((struct GNUNET_CONFIGURATION_Handle
-                                              *) cfg, "arm", "CONFIG",
-                                             cfgfile);
-    }
-    else
-      GNUNET_free (armconfig);
-  }
   arm = GNUNET_ARM_connect (cfg, &arm_conn, NULL);
   if (NULL == arm)
     return;