- fix coverity 10365
[oweals/gnunet.git] / src / namestore / gnunet-namestore.c
index 7fc3ad45f38c937bffb78bb0a3fb8e0448da607e..a79ec5e78d59aa8fc113712e5a35043baafc72a1 100644 (file)
@@ -277,7 +277,7 @@ display_record (void *cls,
   const char *typestring;
   char *s;
   unsigned int i;
-  char *etime;
+  const char *etime;
   struct GNUNET_TIME_Absolute aex;
   struct GNUNET_TIME_Relative rex;
 
@@ -308,7 +308,7 @@ display_record (void *cls,
     if (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION))
     {
       rex.rel_value = rd[i].expiration_time;
-      etime = GNUNET_STRINGS_relative_time_to_string (rex);
+      etime = GNUNET_STRINGS_relative_time_to_string (rex, GNUNET_YES);
     }
     else
     {
@@ -320,7 +320,6 @@ display_record (void *cls,
             ? _(/* what follows is relative expiration */ "for at least")
             : _(/* what follows is absolute expiration */ "until"),
             etime);
-    GNUNET_free (etime);
     GNUNET_free (s);    
   }
   FPRINTF (stdout, "%s", "\n");
@@ -618,9 +617,8 @@ testservice_task (void *cls,
     if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
                                                               "ZONEKEY", &keyfile))
     {
-      fprintf (stderr,
-               _("Option `%s' not given, but I need a zone key file!\n"),
-               "z");
+      GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+                                "gns", "ZONEKEY");
       return;
     }
     fprintf (stderr,
@@ -720,8 +718,11 @@ main (int argc, char *const *argv)
                          _("GNUnet zone manipulation tool"), 
                          options,
                          &run, NULL))
+  {
+    GNUNET_free ((void*) argv);
     return 1;
-
+  }
+  GNUNET_free ((void*) argv);
   return ret;
 }