summaryrefslogtreecommitdiff
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,
int protocol)
{
struct GNUNET_NETWORK_Handle *ret;
+ int fd;
- ret = GNUNET_new (struct GNUNET_NETWORK_Handle);
- ret->fd = socket (domain, type, protocol);
- if (-1 == ret->fd)
- {
- GNUNET_free (ret);
+ fd = socket (domain, type, protocol);
+ if (-1 == fd)
return NULL;
- }
+ ret = GNUNET_new (struct GNUNET_NETWORK_Handle);
+ ret->fd = fd;
if (GNUNET_OK !=
initialize_network_handle (ret,
domain,