check for connect failure
authorChristian Grothoff <christian@grothoff.org>
Thu, 29 Oct 2009 23:24:10 +0000 (23:24 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 29 Oct 2009 23:24:10 +0000 (23:24 +0000)
src/core/core_api.c

index 2157584ab7ca6132e050ab6e18507af0ba5e081b..2a04e24831e2686c1285384f93ef357ffc295e39 100644 (file)
@@ -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)