properly handle error on empty queue
authorChristian Grothoff <christian@grothoff.org>
Fri, 10 Mar 2017 16:28:03 +0000 (17:28 +0100)
committerChristian Grothoff <christian@grothoff.org>
Fri, 10 Mar 2017 16:28:03 +0000 (17:28 +0100)
src/datastore/datastore_api.c

index cf7c7bb1a7b2b20879bca88f0b289745eb579dce..ef7cd7532b8606785be9642b50f34627a3c3a4ca 100644 (file)
@@ -323,14 +323,14 @@ mq_error_handler (void *cls,
        "MQ error, reconnecting to DATASTORE\n");
   do_disconnect (h);
   qe = h->queue_head;
+  if (NULL == qe)
+    return;
   if (NULL != qe->delay_warn_task)
   {
     GNUNET_SCHEDULER_cancel (qe->delay_warn_task);
     qe->delay_warn_task = NULL;
   }
-
-  if ( (NULL != qe) &&
-       (NULL == qe->env) )
+  if (NULL == qe->env)
   {
     union QueueContext qc = qe->qc;
     uint16_t rt = qe->response_type;