fix Null Test After Dereference
authorlurchi <lurchi@strangeplace.net>
Fri, 2 Feb 2018 17:38:54 +0000 (18:38 +0100)
committerlurchi <lurchi@strangeplace.net>
Fri, 2 Feb 2018 17:38:54 +0000 (18:38 +0100)
src/psyc/gnunet-service-psyc.c

index cf161435a626269ac4525bd852f0fc40956fb628..49779ef2c39242ef9c9936ed333de0e26b526f75 100644 (file)
@@ -2185,13 +2185,11 @@ master_transmit_message (struct Master *mst)
     return;
   if (NULL == mst->tmit_handle)
   {
-    mst->tmit_handle = (void *) &mst->tmit_handle;
-    struct GNUNET_MULTICAST_OriginTransmitHandle *
-      tmit_handle = GNUNET_MULTICAST_origin_to_all (mst->origin, tmit_msg->id,
-                                                    mst->max_group_generation,
-                                                    master_transmit_notify, mst);
-    if (NULL != mst->tmit_handle)
-      mst->tmit_handle = tmit_handle;
+    mst->tmit_handle = GNUNET_MULTICAST_origin_to_all (mst->origin,
+                                                       tmit_msg->id,
+                                                       mst->max_group_generation,
+                                                       &master_transmit_notify,
+                                                       mst);
   }
   else
   {
@@ -2210,12 +2208,10 @@ slave_transmit_message (struct Slave *slv)
     return;
   if (NULL == slv->tmit_handle)
   {
-    slv->tmit_handle = (void *) &slv->tmit_handle;
-    struct GNUNET_MULTICAST_MemberTransmitHandle *
-      tmit_handle = GNUNET_MULTICAST_member_to_origin (slv->member, slv->channel.tmit_head->id,
-                                                       slave_transmit_notify, slv);
-    if (NULL != slv->tmit_handle)
-      slv->tmit_handle = tmit_handle;
+    slv->tmit_handle = GNUNET_MULTICAST_member_to_origin (slv->member,
+                                                          slv->channel.tmit_head->id,
+                                                          &slave_transmit_notify,
+                                                          slv);
   }
   else
   {