From 53e2c52d8a0f812763fe57d13fb2b22d6e51e2b8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 29 Oct 2009 23:24:10 +0000 Subject: [PATCH] check for connect failure --- src/core/core_api.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/core_api.c b/src/core/core_api.c index 2157584ab..2a04e2483 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -808,6 +808,12 @@ GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched, h->outbound_hdr_only = outbound_hdr_only; h->handlers = handlers; h->client = GNUNET_CLIENT_connect (sched, "core", cfg); + if (h->client == NULL) + { + init (cls, NULL, NULL, NULL); + GNUNET_free (h); + return; + } h->startup_timeout = GNUNET_TIME_relative_to_absolute (timeout); h->hcnt = 0; while (handlers[h->hcnt].callback != NULL) -- 2.25.1