- dont use pointer after free
authorBart Polot <bart@net.in.tum.de>
Fri, 4 Jul 2014 12:29:06 +0000 (12:29 +0000)
committerBart Polot <bart@net.in.tum.de>
Fri, 4 Jul 2014 12:29:06 +0000 (12:29 +0000)
src/cadet/gnunet-service-cadet_connection.c

index af8f69bb544d9410d1c05e1e50320a5ccb20a6f2..f6ac0ef8f3a3ec4d044f6dc35b8be7f9abaa4fa1 100644 (file)
@@ -1787,6 +1787,7 @@ GCC_handle_broken (void* cls,
 {
   struct GNUNET_CADET_ConnectionBroken *msg;
   struct CadetConnection *c;
+  struct CadetTunnel *t;
   int fwd;
 
   msg = (struct GNUNET_CADET_ConnectionBroken *) message;
@@ -1814,10 +1815,11 @@ GCC_handle_broken (void* cls,
     path_invalidate (c->path);
     GCP_notify_broken_link (endpoint, &msg->peer1, &msg->peer2);
     c->state = CADET_CONNECTION_DESTROYED;
+    t = c->t;
     while (NULL != (out_msg = GCP_connection_pop (neighbor, c)))
     {
       GNUNET_assert (NULL ==
-                     GCT_send_prebuilt_message (out_msg, c->t, NULL, GNUNET_YES,
+                     GCT_send_prebuilt_message (out_msg, t, NULL, GNUNET_YES,
                                                 NULL, NULL));
     }