/**
- * @brief Remove the channel context from the DLL and free the memory.
+ * @brief Free memory and NULL pointers.
*
* @param channel_ctx The channel context.
*/
GNUNET_free (channel_ctx);
peer_ctx->recv_channel_ctx = NULL;
}
- else
- {
- GNUNET_assert (0);
- }
}
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);