- invalid read when socket is already bound
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 27 Apr 2012 12:21:33 +0000 (12:21 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 27 Apr 2012 12:21:33 +0000 (12:21 +0000)
src/transport/plugin_transport_unix.c

index 041a7997af0c8433b81ae5b6cd923b0c19c291b6..0d5a8452830f23b558d3c0e524f6358851126326 100644 (file)
@@ -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;
 }