From: Christian Grothoff Date: Fri, 29 Jun 2012 13:54:00 +0000 (+0000) Subject: -fixes X-Git-Tag: initial-import-from-subversion-38251~12735 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4063a80951c4c42a49f3811b81b3b642634dcd31;p=oweals%2Fgnunet.git -fixes --- diff --git a/src/dns/dnsparser.c b/src/dns/dnsparser.c index c2afbdf3a..4b0c03a77 100644 --- a/src/dns/dnsparser.c +++ b/src/dns/dnsparser.c @@ -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); diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index ec90ae2d5..f7026554d 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c @@ -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)) { diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 8ba955dea..873420460 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -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)))) diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index 68e7fa04b..6268360f2 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c @@ -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); }