mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 22:47:50 +00:00
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
This commit is contained in:
parent
d5b1f4fa5f
commit
d61cb2714c
@ -795,6 +795,8 @@ int Socket_plugin::close(Libc::File_descriptor *fd)
|
|||||||
Socket_context *context = dynamic_cast<Socket_context *>(fd->context);
|
Socket_context *context = dynamic_cast<Socket_context *>(fd->context);
|
||||||
if (!context) return Errno(EBADF);
|
if (!context) return Errno(EBADF);
|
||||||
|
|
||||||
|
::unlink(context->path.base());
|
||||||
|
|
||||||
Genode::destroy(Genode::env()->heap(), context);
|
Genode::destroy(Genode::env()->heap(), context);
|
||||||
Libc::file_descriptor_allocator()->free(fd);
|
Libc::file_descriptor_allocator()->free(fd);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user