- fix use after free
authorBart Polot <bart@net.in.tum.de>
Fri, 18 Oct 2013 15:29:37 +0000 (15:29 +0000)
committerBart Polot <bart@net.in.tum.de>
Fri, 18 Oct 2013 15:29:37 +0000 (15:29 +0000)
src/mesh/gnunet-service-mesh_connection.c

index c31504cfb725241fa873bd9174980cfa412de065..3abaeda0b095a04a0e8e78bde64ffc7b863b16ec 100644 (file)
@@ -804,15 +804,14 @@ connection_cancel_queues (struct MeshConnection *c, int fwd)
     return;
   }
 
-  peer = get_hop (c, fwd);
-  GMP_queue_cancel (peer, c);
-
   fc = fwd ? &c->fwd_fc : &c->bck_fc;
   if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task)
   {
     GNUNET_SCHEDULER_cancel (fc->poll_task);
     fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
   }
+  peer = get_hop (c, fwd);
+  GMP_queue_cancel (peer, c);
 }