From: anryko Date: Sun, 7 Jan 2018 14:43:29 +0000 (+0100) Subject: Fixed potential NULL dereference. X-Git-Tag: gnunet-0.11.0rc0~2^2~15 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=800cb255ea7ae4e6b55095949bc84eb864c08b2e;p=oweals%2Fgnunet.git Fixed potential NULL dereference. --- diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c index b3cf2e946..72f343627 100644 --- a/src/nat/gnunet-nat.c +++ b/src/nat/gnunet-nat.c @@ -377,10 +377,16 @@ run (void *cls, ls = GNUNET_NETWORK_socket_create (af, SOCK_DGRAM, IPPROTO_UDP); + if (NULL == ls) + { + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, + "Failed to create socket\n"); + goto fail_and_shutdown; + } if (GNUNET_OK != - GNUNET_NETWORK_socket_bind (ls, - local_sa, - local_len)) + GNUNET_NETWORK_socket_bind (ls, + local_sa, + local_len)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to bind to %s: %s\n",