From: Christian Grothoff Date: Mon, 23 Jan 2017 13:57:36 +0000 (+0100) Subject: handle case of MQM being already NULL X-Git-Tag: taler-0.2.1~330 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b25a64c10b76c48ce1eda6bc923ff40a82f0a673;p=oweals%2Fgnunet.git handle case of MQM being already NULL --- 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;