checking if pending_head is NULL, may not be correct
authorNathan S. Evans <evans@in.tum.de>
Mon, 22 Nov 2010 12:29:21 +0000 (12:29 +0000)
committerNathan S. Evans <evans@in.tum.de>
Mon, 22 Nov 2010 12:29:21 +0000 (12:29 +0000)
src/core/core_api.c

index 48de0a2147fa55f03f510bb52b08e41e47855d52..02c9e43a291699b022c2179af4d8f2746a5dfc8f 100644 (file)
@@ -666,6 +666,12 @@ transmit_message (void *cls,
   /* now check for 'ready' P2P messages */
   if (NULL != (pr = h->ready_peer_head))
     {
+      /* FIXME: If a reconnect_later call happened, this can be NULL! */
+      if (pr->pending_head == NULL)
+        {
+          GNUNET_break(0);
+          return 0;
+        }
       th = pr->pending_head;
       if (size < th->msize + sizeof (struct SendMessage))
        {