can now be NULL, check
authorChristian Grothoff <christian@grothoff.org>
Sun, 25 Oct 2009 10:22:49 +0000 (10:22 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 25 Oct 2009 10:22:49 +0000 (10:22 +0000)
src/util/client.c

index d5358cab4677db059d5290b978df784c0e481d4a..fb4c1c280b55ef95b4d04580f6c6f078c99fd9d2 100644 (file)
@@ -221,9 +221,11 @@ finish_cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 void
 GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock)
 {
-  GNUNET_assert (sock->sock != NULL);
-  GNUNET_CONNECTION_destroy (sock->sock);
-  sock->sock = NULL;
+  if (sock->sock != NULL)
+    {
+      GNUNET_CONNECTION_destroy (sock->sock);
+      sock->sock = NULL;
+    }
   sock->receiver_handler = NULL;
   if (sock->in_receive == GNUNET_YES)
     sock->in_receive = GNUNET_SYSERR;