gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r30873 - gnunet/src/set


From: gnunet
Subject: [GNUnet-SVN] r30873 - gnunet/src/set
Date: Tue, 26 Nov 2013 15:40:52 +0100

Author: dold
Date: 2013-11-26 15:40:51 +0100 (Tue, 26 Nov 2013)
New Revision: 30873

Modified:
   gnunet/src/set/set_api.c
Log:
- check for null in mq/client when disconnecting listeners


Modified: gnunet/src/set/set_api.c
===================================================================
--- gnunet/src/set/set_api.c    2013-11-26 13:14:41 UTC (rev 30872)
+++ gnunet/src/set/set_api.c    2013-11-26 14:40:51 UTC (rev 30873)
@@ -711,8 +711,17 @@
 GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh)
 {
   LOG (GNUNET_ERROR_TYPE_DEBUG, "canceling listener\n");
-  GNUNET_MQ_destroy (lh->mq);
-  GNUNET_CLIENT_disconnect (lh->client);
+  /* listener's connection may have failed, thus mq/client could be NULL */
+  if (NULL != lh->mq)
+  {
+    GNUNET_MQ_destroy (lh->mq);
+    lh->mq = NULL;
+  }
+  if (NULL != lh->client)
+  {
+    GNUNET_CLIENT_disconnect (lh->client);
+    lh->client = NULL;
+  }
   GNUNET_free (lh);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]