fix crash
authorChristian Grothoff <christian@grothoff.org>
Fri, 9 Dec 2011 16:09:04 +0000 (16:09 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 9 Dec 2011 16:09:04 +0000 (16:09 +0000)
src/statistics/statistics_api.c

index 8e80a4d75f9a39fad48074aba6191e083c1df9cc..8e453bfd40dbd00adfc9ebe5b7f32e038a110601 100644 (file)
@@ -679,6 +679,8 @@ transmit_action (void *cls, size_t size, void *buf)
   size_t ret;
 
   handle->th = NULL;
+  if (NULL == handle->current)
+    return 0;
   switch (handle->current->type)
   {
   case ACTION_GET:
@@ -877,6 +879,7 @@ schedule_action (struct GNUNET_STATISTICS_Handle *h)
   }
   GNUNET_CONTAINER_DLL_remove (h->action_head, h->action_tail, h->current);
   timeout = GNUNET_TIME_absolute_get_remaining (h->current->timeout);
+  GNUNET_assert (NULL == h->th);
   if (NULL ==
       (h->th =
        GNUNET_CLIENT_notify_transmit_ready (h->client, h->current->msize,