From 4c9b6c0fb88b2adc96c29aee731b3be742003f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 30 Jan 2017 11:19:51 +0100 Subject: [PATCH] Properly check return value of createDatagramSocket. --- source/vibe/core/net.d | 1 + 1 file changed, 1 insertion(+) diff --git a/source/vibe/core/net.d b/source/vibe/core/net.d index b21ab12..117c1f4 100644 --- a/source/vibe/core/net.d +++ b/source/vibe/core/net.d @@ -700,6 +700,7 @@ struct UDPConnection { private this(ref NetworkAddress bind_address) { m_socket = eventDriver.sockets.createDatagramSocket(bind_address.toUnknownAddress(), null); + enforce(m_socket != DatagramSocketFD.invalid, "Failed to create datagram socket."); m_context = () @trusted { return &eventDriver.core.userData!Context(m_socket); } (); m_context.localAddress = bind_address; }