From: Matthias Wachs Date: Fri, 27 Apr 2012 12:21:33 +0000 (+0000) Subject: - invalid read when socket is already bound X-Git-Tag: initial-import-from-subversion-38251~13742 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b863769f273b757628c0070bdf6416978d110684;p=oweals%2Fgnunet.git - invalid read when socket is already bound --- diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index 041a7997a..0d5a84528 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c @@ -321,10 +321,13 @@ unix_transport_server_stop (void *cls) plugin->select_task = GNUNET_SCHEDULER_NO_TASK; } - GNUNET_break (GNUNET_OK == - GNUNET_NETWORK_socket_close (plugin->unix_sock.desc)); - plugin->unix_sock.desc = NULL; - plugin->with_ws = GNUNET_NO; + if (NULL != plugin->unix_sock.desc) + { + GNUNET_break (GNUNET_OK == + GNUNET_NETWORK_socket_close (plugin->unix_sock.desc)); + plugin->unix_sock.desc = NULL; + plugin->with_ws = GNUNET_NO; + } return GNUNET_OK; }