summaryrefslogtreecommitdiff
path: root/Libraries/LibCore
diff options
context:
space:
mode:
authorMuhammad Zahalqa <m@tryfinally.com>2020-08-08 14:57:03 +0300
committerAndreas Kling <kling@serenityos.org>2020-08-09 21:10:01 +0200
commit0246e2ae6c881d4295a70f7b7f8c3a2cccfc1f1c (patch)
treede9d33de6e4353bf02887525a63cd5362ad72182 /Libraries/LibCore
parent5ae2f6e9ec077432dc56d5cb8fc5c26c5cca8517 (diff)
downloadserenity-0246e2ae6c881d4295a70f7b7f8c3a2cccfc1f1c.zip
LibCore: close socket on UDPServer dtor
Diffstat (limited to 'Libraries/LibCore')
-rw-r--r--Libraries/LibCore/UDPServer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibCore/UDPServer.cpp b/Libraries/LibCore/UDPServer.cpp
index 462ce5f983..2b5b466074 100644
--- a/Libraries/LibCore/UDPServer.cpp
+++ b/Libraries/LibCore/UDPServer.cpp
@@ -30,6 +30,7 @@
#include <LibCore/UDPServer.h>
#include <LibCore/UDPSocket.h>
#include <stdio.h>
+#include <unistd.h>
#ifndef SOCK_NONBLOCK
# include <sys/ioctl.h>
@@ -53,6 +54,7 @@ UDPServer::UDPServer(Object* parent)
UDPServer::~UDPServer()
{
+ ::close(m_fd);
}
bool UDPServer::bind(const IPv4Address& address, u16 port)