From: Julius Bünger Date: Mon, 13 Aug 2018 17:08:02 +0000 (+0200) Subject: Fix documentation and assertions X-Git-Tag: v0.11.0~309^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b67807b3e8f732054506fb4e229e392013ece923;p=oweals%2Fgnunet.git Fix documentation and assertions --- diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 41769ca24..1f155b14f 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -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);