aboutsummaryrefslogtreecommitdiff
path: root/src/util/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/network.c')
-rw-r--r--src/util/network.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/util/network.c b/src/util/network.c
index 968870def..79c25c4d0 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -931,14 +931,13 @@ GNUNET_NETWORK_socket_create (int domain,
931 int protocol) 931 int protocol)
932{ 932{
933 struct GNUNET_NETWORK_Handle *ret; 933 struct GNUNET_NETWORK_Handle *ret;
934 int fd;
934 935
935 ret = GNUNET_new (struct GNUNET_NETWORK_Handle); 936 fd = socket (domain, type, protocol);
936 ret->fd = socket (domain, type, protocol); 937 if (-1 == fd)
937 if (-1 == ret->fd)
938 {
939 GNUNET_free (ret);
940 return NULL; 938 return NULL;
941 } 939 ret = GNUNET_new (struct GNUNET_NETWORK_Handle);
940 ret->fd = fd;
942 if (GNUNET_OK != 941 if (GNUNET_OK !=
943 initialize_network_handle (ret, 942 initialize_network_handle (ret,
944 domain, 943 domain,