aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cadet/cadet_api_new.c2
-rw-r--r--src/cadet/gnunet-service-cadet-new_channel.c18
-rw-r--r--src/util/client.c2
3 files changed, 19 insertions, 3 deletions
diff --git a/src/cadet/cadet_api_new.c b/src/cadet/cadet_api_new.c
index 8d778e10e..673764813 100644
--- a/src/cadet/cadet_api_new.c
+++ b/src/cadet/cadet_api_new.c
@@ -346,6 +346,8 @@ destroy_channel (struct GNUNET_CADET_Channel *ch)
346 if (NULL != ch->disconnects) 346 if (NULL != ch->disconnects)
347 ch->disconnects (ch->ctx, 347 ch->disconnects (ch->ctx,
348 ch); 348 ch);
349 if (NULL != ch->pending_env)
350 GNUNET_MQ_discard (ch->pending_env);
349 GNUNET_MQ_destroy (ch->mq); 351 GNUNET_MQ_destroy (ch->mq);
350 GNUNET_free (ch); 352 GNUNET_free (ch);
351} 353}
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c
index e94800593..828c3daa7 100644
--- a/src/cadet/gnunet-service-cadet-new_channel.c
+++ b/src/cadet/gnunet-service-cadet-new_channel.c
@@ -1043,15 +1043,27 @@ GCCH_channel_local_destroy (struct CadetChannel *ch,
1043 channel_destroy (ch); 1043 channel_destroy (ch);
1044 return; 1044 return;
1045 } 1045 }
1046 if ( (NULL != ch->head_sent) || 1046 if ( (NULL != ch->head_sent) &&
1047 (NULL != ch->owner) || 1047 ( (NULL != ch->owner) ||
1048 (NULL != ch->dest) ) 1048 (NULL != ch->dest) ) )
1049 { 1049 {
1050 /* Wait for other end to destroy us as well, 1050 /* Wait for other end to destroy us as well,
1051 and otherwise allow send queue to be transmitted first */ 1051 and otherwise allow send queue to be transmitted first */
1052 ch->destroy = GNUNET_YES; 1052 ch->destroy = GNUNET_YES;
1053 return; 1053 return;
1054 } 1054 }
1055 if (GNUNET_YES == ch->is_loopback)
1056 {
1057 struct CadetChannelClient *ccc;
1058
1059 /* Find which end is left... */
1060 ccc = (NULL != ch->owner) ? ch->owner : ch->dest;
1061 GSC_handle_remote_channel_destroy (ccc->c,
1062 ccc->ccn,
1063 ch);
1064 channel_destroy (ch);
1065 return;
1066 }
1055 /* If the we ever sent the CHANNEL_CREATE, we need to send a destroy message. */ 1067 /* If the we ever sent the CHANNEL_CREATE, we need to send a destroy message. */
1056 switch (ch->state) 1068 switch (ch->state)
1057 { 1069 {
diff --git a/src/util/client.c b/src/util/client.c
index 4fd971040..1cf819f9d 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -510,6 +510,8 @@ try_unixpath (const char *service_name,
510 GNUNET_free (unixpath); 510 GNUNET_free (unixpath);
511 return sock; 511 return sock;
512 } 512 }
513 if (NULL != sock)
514 GNUNET_NETWORK_socket_close (sock);
513 } 515 }
514 GNUNET_free_non_null (unixpath); 516 GNUNET_free_non_null (unixpath);
515#endif 517#endif