- Allocate buffer large enough to contain UNIX_PATH_MAX size pathnames in case of...
[oweals/gnunet.git] / src / util / gnunet-config.c
index 78c93c3b854900d0c4f37b4d4fdfdb5e63852d6b..1d204dd07a6566af2fbf458e837a3eaba81ee969 100644 (file)
@@ -61,12 +61,12 @@ static int ret;
  * @param option name of the option
  * @param value value of the option
  */
-static void 
+static void
 print_option (void *cls, const char *section,
              const char *option,
              const char *value)
 {
-  fprintf (stdout, 
+  fprintf (stdout,
           "%s = %s\n", option, value);
 }
 
@@ -136,11 +136,11 @@ run (void *cls, char *const *args, const char *cfgfile,
     }
     out = GNUNET_CONFIGURATION_dup (cfg);
     GNUNET_CONFIGURATION_set_value_string (out, section, option, value);
-    if (GNUNET_OK != 
+    if (GNUNET_OK !=
        GNUNET_CONFIGURATION_write (out, cfgfile))
       ret = 2;
     GNUNET_CONFIGURATION_destroy (out);
-    return;    
+    return;
   }
 }
 
@@ -170,14 +170,15 @@ main (int argc, char *const *argv)
       1, &GNUNET_GETOPT_set_string, &value },
     GNUNET_GETOPT_OPTION_END
   };
-
   if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
     return 2;
 
-  return (GNUNET_OK ==
-          GNUNET_PROGRAM_run (argc, argv, "gnunet-config [OPTIONS]",
-                              gettext_noop ("Manipulate GNUnet configuration files"),
-                              options, &run, NULL)) ? 0 : ret;
+  ret = (GNUNET_OK ==
+        GNUNET_PROGRAM_run (argc, argv, "gnunet-config [OPTIONS]",
+                            gettext_noop ("Manipulate GNUnet configuration files"),
+                            options, &run, NULL)) ? 0 : ret;
+  GNUNET_free ((void*) argv);
+  return ret;
 }
 
 /* end of gnunet-config.c */