From b25a64c10b76c48ce1eda6bc923ff40a82f0a673 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 23 Jan 2017 14:57:36 +0100 Subject: [PATCH] handle case of MQM being already NULL --- src/cadet/gnunet-service-cadet-new_connection.c | 9 ++++++--- src/cadet/gnunet-service-cadet-new_core.c | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cadet/gnunet-service-cadet-new_connection.c b/src/cadet/gnunet-service-cadet-new_connection.c index c44511400..b365599bf 100644 --- a/src/cadet/gnunet-service-cadet-new_connection.c +++ b/src/cadet/gnunet-service-cadet-new_connection.c @@ -173,9 +173,12 @@ GCC_destroy (struct CadetConnection *cc) GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY); destroy_msg->cid = cc->cid; } - GCP_request_mq_cancel (cc->mq_man, - env); - cc->mq_man = NULL; + if (NULL != cc->mq_man) + { + GCP_request_mq_cancel (cc->mq_man, + env); + cc->mq_man = NULL; + } if (NULL != cc->task) { GNUNET_SCHEDULER_cancel (cc->task); diff --git a/src/cadet/gnunet-service-cadet-new_core.c b/src/cadet/gnunet-service-cadet-new_core.c index 1e35a5102..8de780ce0 100644 --- a/src/cadet/gnunet-service-cadet-new_core.c +++ b/src/cadet/gnunet-service-cadet-new_core.c @@ -312,6 +312,8 @@ send_broken (struct RouteDirection *target, struct GNUNET_MQ_Envelope *env; struct GNUNET_CADET_ConnectionBrokenMessage *bm; + if (NULL == target->mqm) + return; /* Can't send notification, connection is down! */ LOG (GNUNET_ERROR_TYPE_DEBUG, "Notifying %s about BROKEN route at %s-%s of connection %s\n", GCP_2s (target->hop), @@ -326,6 +328,7 @@ send_broken (struct RouteDirection *target, bm->peer1 = *peer1; if (NULL != peer2) bm->peer2 = *peer2; + GCP_request_mq_cancel (target->mqm, env); target->mqm = NULL; -- 2.25.1