fail on fatal connect error
authorChristian Grothoff <christian@grothoff.org>
Tue, 21 Dec 2010 16:22:05 +0000 (16:22 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 21 Dec 2010 16:22:05 +0000 (16:22 +0000)
src/statistics/statistics_api.c

index 5bca6c786b67f38a59f68ceca31f70e9fe7f04ba..b697d33f193ad5df90197e9e47afe3c868d10861 100644 (file)
@@ -738,7 +738,12 @@ GNUNET_STATISTICS_create (const char *subsystem,
   ret->cfg = cfg;
   ret->subsystem = GNUNET_strdup (subsystem);
   ret->backoff = GNUNET_TIME_UNIT_MILLISECONDS;
-  try_connect (ret);
+  if (GNUNET_YES != try_connect (ret))
+    {
+      GNUNET_free (ret->subsystem);
+      GNUNET_free (ret);
+      return NULL;
+    }
   return ret;
 }