diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-11-26 14:40:51 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-11-26 14:40:51 +0000 |
commit | 539505c0b22e986a472ee0df74df377f7a98da40 (patch) | |
tree | 101e8b03dc0b72350bdf9a32d96add8e0038b66c /src/set | |
parent | 97cd15acabbcfa2357aeecd15df3297a5cbe08aa (diff) | |
download | gnunet-539505c0b22e986a472ee0df74df377f7a98da40.tar.gz gnunet-539505c0b22e986a472ee0df74df377f7a98da40.zip |
- check for null in mq/client when disconnecting listeners
Diffstat (limited to 'src/set')
-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 | ||