summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_unix.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-03-28 13:39:12 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-03-28 13:39:12 +0000
commitc4245a9d06bbefac2638c009fd48287a22ed05e4 (patch)
treed5f373f8e211229fd15677263b554838a0b5df75 /src/transport/plugin_transport_unix.c
parent0946e217c746adf49291643eca33f009af10e104 (diff)
make plugin fail if bind fails ...
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r--src/transport/plugin_transport_unix.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index e48606f8f..a7cbbf39c 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -1672,9 +1672,15 @@ libgnunet_plugin_transport_unix_init (void *cls)
api->get_network = &unix_get_network;
api->update_session_timeout = &unix_plugin_update_session_timeout;
sockets_created = unix_transport_server_start (plugin);
- if (0 == sockets_created)
+ if ((0 == sockets_created) || (GNUNET_SYSERR == sockets_created))
+ {
LOG (GNUNET_ERROR_TYPE_WARNING,
_("Failed to open UNIX listen socket\n"));
+ GNUNET_free (api);
+ GNUNET_free (plugin->unix_socket_path);
+ GNUNET_free (plugin);
+ return NULL;
+ }
plugin->session_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO);
plugin->address_update_task = GNUNET_SCHEDULER_add_now (&address_notification, plugin);
return api;