- fix coverity
[oweals/gnunet.git] / src / scalarproduct / gnunet-service-scalarproduct-ecc_alice.c
index 0e1f3ba6a29b5df5ae95931d8b7d7adea3cff7e3..bf5ee124193e7b09e317abda2477d3a82a43c3ec 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2013-2015 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2013-2015 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -311,6 +311,8 @@ prepare_client_end_notification (struct AliceServiceSession *session)
   struct ClientResponseMessage *msg;
   struct GNUNET_MQ_Envelope *e;
 
+  if (NULL == session->client_mq)
+    return; /* no client left to be notified */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Sending session-end notification with status %d to client for session %s\n",
               session->status,
@@ -470,7 +472,7 @@ compute_scalar_product (struct AliceServiceSession *session,
   ai_bi = GNUNET_CRYPTO_ecc_dlog (edc,
                                   g_ai_bi);
   gcry_mpi_point_release (g_ai_bi);
-  if (MAX_RESULT == ai_bi)
+  if (INT_MAX == ai_bi)
   {
     /* result too big */
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1092,8 +1094,7 @@ GSS_handle_alice_client_message (void *cls,
  * @param tc unused
  */
 static void
-shutdown_task (void *cls,
-               const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Shutting down, initiating cleanup.\n");
@@ -1194,9 +1195,8 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                                &shutdown_task,
-                                NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+                                NULL);
 
 }