From b863769f273b757628c0070bdf6416978d110684 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 27 Apr 2012 12:21:33 +0000 Subject: [PATCH] - invalid read when socket is already bound --- src/transport/plugin_transport_unix.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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; } -- 2.25.1