From e697fe7d7bda59cf23186d73d0522b984cd758b4 Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Wed, 16 Nov 2016 15:21:31 +0900 Subject: [PATCH] Check return value of GNUNET_NETWORK_socket_create --- src/util/client_new.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/util/client_new.c b/src/util/client_new.c index 593d3a268..337d06734 100644 --- a/src/util/client_new.c +++ b/src/util/client_new.c @@ -495,11 +495,12 @@ try_unixpath (const char *service_name, sock = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0); - if ( (GNUNET_OK == - GNUNET_NETWORK_socket_connect (sock, - (struct sockaddr *) &s_un, - sizeof (s_un))) || - (EINPROGRESS == errno) ) + if ( (NULL != sock) && + ( (GNUNET_OK == + GNUNET_NETWORK_socket_connect (sock, + (struct sockaddr *) &s_un, + sizeof (s_un))) || + (EINPROGRESS == errno) ) ) { LOG (GNUNET_ERROR_TYPE_DEBUG, "Successfully connected to unixpath `%s'!\n", -- 2.25.1