fix
[oweals/gnunet.git] / src / core / core_api.c
index 5f21d8478590de66898507fb5b3dd941a5299d63..c21be318a4ffac0fd5fcee4480fd523b36340e1d 100644 (file)
@@ -317,8 +317,10 @@ request_start (void *cls, size_t size, void *buf)
   struct GNUNET_CORE_TransmitHandle *th;
   size_t ret;
 
-  h->cth = NULL;
+  h->cth = NULL;  
   th = h->pending_head;
+  if (th == NULL)
+    return 0;
   if (buf == NULL)
     {
       timeout_request (th, NULL);
@@ -725,6 +727,7 @@ transmit_start (void *cls, size_t size, void *buf)
  *        connected to the core service; note that timeout is only meaningful if init is not NULL
  * @param connects function to call on peer connect, can be NULL
  * @param disconnects function to call on peer disconnect / timeout, can be NULL
+ * @param status_events function to call on changes to peer connection status, can be NULL
  * @param inbound_notify function to call for all inbound messages, can be NULL
  * @param inbound_hdr_only set to GNUNET_YES if inbound_notify will only read the
  *                GNUNET_MessageHeader and hence we do not need to give it the full message;
@@ -811,6 +814,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
     GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task);
   if (handle->client_notifications != NULL)
     GNUNET_CLIENT_disconnect (handle->client_notifications, GNUNET_NO);
+  GNUNET_break (handle->pending_head == NULL);
   GNUNET_free_non_null (handle->solicit_buffer);
   GNUNET_free (handle);
 }