fix more field initialziation order issues
authorChristian Grothoff <christian@grothoff.org>
Mon, 9 Jan 2017 06:17:19 +0000 (07:17 +0100)
committerChristian Grothoff <christian@grothoff.org>
Mon, 9 Jan 2017 06:17:19 +0000 (07:17 +0100)
src/cadet/gnunet-service-cadet_channel.c
src/cadet/gnunet-service-cadet_tunnel.c

index 22349aa80c5cf26acb979750eb58ca680be54e77..6f32bdc81cc73c43b68ab92d0f16a4c83662702e 100644 (file)
@@ -2495,17 +2495,18 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
         }
       }
 
+      chq->rel->uniq = chq;
       chq->tq = GCT_send_prebuilt_message (message, ch->t, NULL, GNUNET_YES,
                                            &ch_message_sent, chq);
       if (NULL == chq->tq)
       {
         GNUNET_break (0);
+       chq->rel->uniq = NULL;
         GCT_debug (ch->t, GNUNET_ERROR_TYPE_ERROR);
         GNUNET_free (chq);
         chq = NULL;
         return;
       }
-      chq->rel->uniq = chq;
       break;
 
 
index 5b07e42c068be3103a68aa11820cc4292d53bc91..6ddcf65986255a0c77728434120c9d740d6985ad 100644 (file)
@@ -1418,11 +1418,11 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
     tq = existing_q;
     tq->tqd = NULL;
   }
+  tq->cont = cont;
+  tq->cont_cls = cont_cls;
   tq->cq = GCC_send_prebuilt_message (msg, type, mid, c, fwd, force,
                                       &tun_message_sent, tq);
   GNUNET_assert (NULL != tq->cq);
-  tq->cont = cont;
-  tq->cont_cls = cont_cls;
 
   return tq;
 }