-fixes
authorChristian Grothoff <christian@grothoff.org>
Fri, 29 Jun 2012 13:54:00 +0000 (13:54 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 29 Jun 2012 13:54:00 +0000 (13:54 +0000)
src/dns/dnsparser.c
src/fs/gnunet-auto-share.c
src/util/common_logging.c
src/util/gnunet-uri.c

index c2afbdf3aae27e62c87216e1f896d71f4ac37238..4b0c03a773b90282a88f09b9a9cc969646706e8e 100644 (file)
@@ -266,10 +266,11 @@ parse_record (const char *udp_payload,
        "_$SERVICE._$PROTO.$DOMAIN_NAME" */
     ndup = GNUNET_strdup (r->name);
     tok = strtok (ndup, ".");
+    GNUNET_assert (NULL != tok);
     GNUNET_assert ('_' == *tok);
     r->data.srv->service = GNUNET_strdup (&tok[1]);
     tok = strtok (NULL, ".");
-    if ('_' != *tok)
+    if ( (NULL == tok) || ('_' != *tok) )
     {
       GNUNET_free (r->data.srv);
       GNUNET_free (ndup);
index ec90ae2d55979d261f4183b05837a35dd5b40066..f7026554d9d956bf22810de6072f8e74d0f141fc 100644 (file)
@@ -283,6 +283,14 @@ save_state ()
   n = GNUNET_CONTAINER_multihashmap_size (work_finished);
   fn = get_state_file ();
   wh = GNUNET_BIO_write_open (fn);
+  if (NULL == wh)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+               _("Failed to save state to file %s\n"),
+               fn);
+    GNUNET_free (fn);
+    return;
+  }
   if (GNUNET_OK !=
       GNUNET_BIO_write_int32 (wh, n))
   {
index 8ba955dea727eea0650737160d81fabb895a8342..8734204606058f7539ad3e0cc72fae0f488f0ea8 100644 (file)
@@ -922,7 +922,8 @@ mylog (enum GNUNET_ErrorType kind, const char *comp, const char *message,
     }
 #endif  
     VSNPRINTF (buf, size, message, va);
-    (void) setup_log_file (tmptr);
+    if (NULL != tmptr)
+      (void) setup_log_file (tmptr);
     if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) &&
         (last_bulk_time.abs_value != 0) &&
         (0 == strncmp (buf, last_bulk, sizeof (last_bulk))))
index 68e7fa04bf4a8081f19bcf1d32632060863f2716..6268360f2b81af6e65bebe1493a129a2ab5d77f2 100644 (file)
@@ -62,7 +62,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
        (0 == code) )
     ret = 0;
   else
-    GNUNET_OS_process_kill (p, SIGTERM);
+    GNUNET_break (0 == GNUNET_OS_process_kill (p, SIGTERM));
   GNUNET_OS_process_destroy (p);
 }
 
@@ -110,8 +110,10 @@ run (void *cls, char *const *args, const char *cfgfile,
                                             &program))
   {
     fprintf (stderr, _("No handler known for subsystem `%s'\n"), subsystem);
+    GNUNET_free (subsystem);
     return;
   }
+  GNUNET_free (subsystem);
   rt = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
                                       GNUNET_DISK_pipe_handle (sigpipe,
                                                                GNUNET_DISK_PIPE_END_READ),
@@ -122,6 +124,7 @@ run (void *cls, char *const *args, const char *cfgfile,
                               program,
                               args[0], 
                               NULL);
+  GNUNET_free (program);
   if (NULL == p)
     GNUNET_SCHEDULER_cancel (rt);
 }