mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 14:37:50 +00:00
lib/vfs/rump: safely destroy dir and file handles
This commit is contained in:
parent
1556300ea6
commit
0923ea5bea
@ -527,11 +527,11 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
|
|
||||||
void close(Vfs_handle *vfs_handle) override
|
void close(Vfs_handle *vfs_handle) override
|
||||||
{
|
{
|
||||||
Rump_vfs_file_handle *rump_handle =
|
if (dynamic_cast<Rump_vfs_file_handle *>(vfs_handle)
|
||||||
static_cast<Rump_vfs_file_handle *>(vfs_handle);
|
|| dynamic_cast<Rump_vfs_dir_handle *>(vfs_handle)) {
|
||||||
|
destroy(vfs_handle->alloc(), vfs_handle);
|
||||||
if (rump_handle)
|
return;
|
||||||
destroy(vfs_handle->alloc(), rump_handle);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Stat_result stat(char const *path, Stat &stat)
|
Stat_result stat(char const *path, Stat &stat)
|
||||||
|
Loading…
Reference in New Issue
Block a user