Fix documentation and assertions
authorJulius Bünger <buenger@mytum.de>
Mon, 13 Aug 2018 17:08:02 +0000 (19:08 +0200)
committerJulius Bünger <buenger@mytum.de>
Mon, 13 Aug 2018 17:08:02 +0000 (19:08 +0200)
src/rps/gnunet-service-rps.c

index 41769ca249cb6928620da5a0f499b1f7482b56b7..1f155b14f1e5c5aa976c142720623301ab8ee0f0 100644 (file)
@@ -625,7 +625,7 @@ add_channel_ctx (struct PeerContext *peer_ctx)
 
 
 /**
- * @brief Remove the channel context from the DLL and free the memory.
+ * @brief Free memory and NULL pointers.
  *
  * @param channel_ctx The channel context.
  */
@@ -645,10 +645,6 @@ remove_channel_ctx (struct ChannelCtx *channel_ctx)
     GNUNET_free (channel_ctx);
     peer_ctx->recv_channel_ctx = NULL;
   }
-  else
-  {
-    GNUNET_assert (0);
-  }
 }
 
 
@@ -869,14 +865,14 @@ check_operation_scheduled (const struct GNUNET_PeerIdentity *peer,
 static void
 destroy_channel (struct ChannelCtx *channel_ctx)
 {
-  struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
   struct GNUNET_CADET_Channel *channel;
-  
+
   if (NULL != channel_ctx->destruction_task)
   {
     GNUNET_SCHEDULER_cancel (channel_ctx->destruction_task);
     channel_ctx->destruction_task = NULL;
   }
+  GNUNET_assert (channel_ctx->channel != NULL);
   channel = channel_ctx->channel;
   channel_ctx->channel = NULL;
   GNUNET_CADET_channel_destroy (channel);