From d61cb2714c9f2ebc91f4bc127c2199e54d2ff088 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Tue, 21 Feb 2017 14:50:24 +0100 Subject: [PATCH] libc/socket_fs: unlink during close If 'close' does not call 'unlink' like 'shutdown', the Lxip_socket_dir never gets destroyed and thus the socket server leaks resources like RAM and ports. Ref #2285 --- repos/libports/src/lib/libc/socket_fs_plugin.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repos/libports/src/lib/libc/socket_fs_plugin.cc b/repos/libports/src/lib/libc/socket_fs_plugin.cc index b07338af84..b81d0a6382 100644 --- a/repos/libports/src/lib/libc/socket_fs_plugin.cc +++ b/repos/libports/src/lib/libc/socket_fs_plugin.cc @@ -795,6 +795,8 @@ int Socket_plugin::close(Libc::File_descriptor *fd) Socket_context *context = dynamic_cast(fd->context); if (!context) return Errno(EBADF); + ::unlink(context->path.base()); + Genode::destroy(Genode::env()->heap(), context); Libc::file_descriptor_allocator()->free(fd);