From 3051850f341a640d5cbbd8c9d66c7030e0d7328e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 21 Dec 2010 16:23:14 +0000 Subject: fail on fatal connect error --- src/statistics/statistics_api.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/statistics') diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index b697d33f1..d44bc77d1 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c @@ -766,6 +766,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, struct GNUNET_TIME_Relative timeout; int i; + if (h == NULL) return; if (GNUNET_SCHEDULER_NO_TASK != h->backoff_task) GNUNET_SCHEDULER_cancel (h->backoff_task); if (sync_first) @@ -918,6 +919,7 @@ schedule_action (struct GNUNET_STATISTICS_Handle *h) } } + /** * Get statistic from the peer. * @@ -1025,6 +1027,8 @@ GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, { struct GNUNET_STATISTICS_WatchEntry *w; + if (handle == NULL) + return GNUNET_SYSERR; w = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_WatchEntry)); w->subsystem = GNUNET_strdup (subsystem); w->name = GNUNET_strdup (name); -- cgit v1.2.3