diff --git a/repos/os/src/lib/vfs/ram_file_system.h b/repos/os/src/lib/vfs/ram_file_system.h index cc6ae4101e..9b9ceada9d 100644 --- a/repos/os/src/lib/vfs/ram_file_system.h +++ b/repos/os/src/lib/vfs/ram_file_system.h @@ -753,11 +753,11 @@ class Vfs::Ram_file_system : public Vfs::File_system Vfs_ram::Node &node = ram_handle->node; bool node_modified = ram_handle->modifying; - ram_handle->node.close(*ram_handle); + node.close(*ram_handle); destroy(vfs_handle->alloc(), ram_handle); - if (ram_handle->node.unlinked() && !ram_handle->node.opened()) { - destroy(_env.alloc(), &ram_handle->node); + if (node.unlinked() && !node.opened()) { + destroy(_env.alloc(), &node); } else if (node_modified) { node.notify(); }