fix
authorChristian Grothoff <christian@grothoff.org>
Fri, 15 Jul 2011 07:55:32 +0000 (07:55 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 15 Jul 2011 07:55:32 +0000 (07:55 +0000)
src/transport/gnunet-service-transport.c

index 1141bdb6415143492c3d8abac10f839b915c97d4..5b91df827126e65aa74c8f325a7f9bb5299f4711 100644 (file)
@@ -6163,6 +6163,8 @@ client_disconnect_notification (void *cls,
   struct ClientMessageQueueEntry *mqe;
   struct Blacklisters *bl;
   struct BlacklistCheck *bc;
+  struct NeighbourList *n;
+  struct MessageQueue *mq;
 
   if (client == NULL)
     return;
@@ -6221,6 +6223,14 @@ client_disconnect_notification (void *cls,
       pos->message_count--;
       GNUNET_free (mqe);
     }
+  for (n = neighbours; n != NULL; n = n->next)
+    {
+      for (mq = n->messages_head; mq != NULL; mq = mq->next)
+       {
+         if (mq->client == pos)
+           mq->client = NULL; /* do not use anymore! */
+       }
+    }
   if (prev == NULL)
     clients = pos->next;
   else