- fix coverity 12989
authorBart Polot <bart@net.in.tum.de>
Mon, 7 Apr 2014 14:14:40 +0000 (14:14 +0000)
committerBart Polot <bart@net.in.tum.de>
Mon, 7 Apr 2014 14:14:40 +0000 (14:14 +0000)
src/mesh/gnunet-service-mesh_peer.c

index 25962b6184ebf5dcaecffc63b2e8cdefeabdc107..607012741e954b2c4a75451e26a3a34958c2d5be 100644 (file)
@@ -1241,11 +1241,13 @@ struct GNUNET_MessageHeader *
 GMP_connection_pop (struct MeshPeer *peer, struct MeshConnection *c)
 {
   struct MeshPeerQueue *q;
+  struct MeshPeerQueue *next;
   struct GNUNET_MessageHeader *msg;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Connection pop on %s\n", GMC_2s (c));
-  for (q = peer->queue_head; NULL != q; q = q->next)
+  for (q = peer->queue_head; NULL != q; q = next)
   {
+    next = q->next;
     if (q->c != c)
       continue;
     switch (q->type)