From: Christian Grothoff Date: Sat, 29 Sep 2012 19:18:13 +0000 (+0000) Subject: -fixing #2569 X-Git-Tag: initial-import-from-subversion-38251~11557 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0d5f97f528f19c8375ee5d9b12decc471c7f009a;p=oweals%2Fgnunet.git -fixing #2569 --- diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c index 2f04ba57d..91f1ae65a 100644 --- a/src/core/gnunet-service-core_clients.c +++ b/src/core/gnunet-service-core_clients.c @@ -899,8 +899,11 @@ GSC_CLIENTS_done () GNUNET_SERVER_notification_context_destroy (notifier); notifier = NULL; } - GNUNET_SERVER_mst_destroy (client_mst); - client_mst = NULL; + if (NULL != client_mst) + { + GNUNET_SERVER_mst_destroy (client_mst); + client_mst = NULL; + } } /* end of gnunet-service-core_clients.c */ diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c index ff0ca73f7..3b1357425 100644 --- a/src/core/gnunet-service-core_neighbours.c +++ b/src/core/gnunet-service-core_neighbours.c @@ -506,14 +506,18 @@ free_neighbour_helper (void *cls, const struct GNUNET_HashCode * key, void *valu void GSC_NEIGHBOURS_done () { - if (NULL == transport) - return; - GNUNET_TRANSPORT_disconnect (transport); - transport = NULL; - GNUNET_CONTAINER_multihashmap_iterate (neighbours, &free_neighbour_helper, - NULL); - GNUNET_CONTAINER_multihashmap_destroy (neighbours); - neighbours = NULL; + if (NULL != transport) + { + GNUNET_TRANSPORT_disconnect (transport); + transport = NULL; + } + if (NULL != neighbours) + { + GNUNET_CONTAINER_multihashmap_iterate (neighbours, &free_neighbour_helper, + NULL); + GNUNET_CONTAINER_multihashmap_destroy (neighbours); + neighbours = NULL; + } } /* end of gnunet-service-core_neighbours.c */ diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index fa69134cb..87fa91189 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c @@ -810,9 +810,12 @@ free_session_helper (void *cls, const struct GNUNET_HashCode * key, void *value) void GSC_SESSIONS_done () { - GNUNET_CONTAINER_multihashmap_iterate (sessions, &free_session_helper, NULL); - GNUNET_CONTAINER_multihashmap_destroy (sessions); - sessions = NULL; + if (NULL != sessions) + { + GNUNET_CONTAINER_multihashmap_iterate (sessions, &free_session_helper, NULL); + GNUNET_CONTAINER_multihashmap_destroy (sessions); + sessions = NULL; + } } /* end of gnunet-service-core_sessions.c */