From b67807b3e8f732054506fb4e229e392013ece923 Mon Sep 17 00:00:00 2001 From: Julius Bünger Date: Mon, 13 Aug 2018 19:08:02 +0200 Subject: Fix documentation and assertions --- src/rps/gnunet-service-rps.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') 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); -- cgit v1.2.3