diff options
-rw-r--r-- | src/set/set_api.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/set/set_api.c b/src/set/set_api.c index 555acf048..54a5767e2 100644 --- a/src/set/set_api.c +++ b/src/set/set_api.c | |||
@@ -711,8 +711,17 @@ void | |||
711 | GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh) | 711 | GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh) |
712 | { | 712 | { |
713 | LOG (GNUNET_ERROR_TYPE_DEBUG, "canceling listener\n"); | 713 | LOG (GNUNET_ERROR_TYPE_DEBUG, "canceling listener\n"); |
714 | GNUNET_MQ_destroy (lh->mq); | 714 | /* listener's connection may have failed, thus mq/client could be NULL */ |
715 | GNUNET_CLIENT_disconnect (lh->client); | 715 | if (NULL != lh->mq) |
716 | { | ||
717 | GNUNET_MQ_destroy (lh->mq); | ||
718 | lh->mq = NULL; | ||
719 | } | ||
720 | if (NULL != lh->client) | ||
721 | { | ||
722 | GNUNET_CLIENT_disconnect (lh->client); | ||
723 | lh->client = NULL; | ||
724 | } | ||
716 | GNUNET_free (lh); | 725 | GNUNET_free (lh); |
717 | } | 726 | } |
718 | 727 | ||