cached_fs_rom: fix file-handle leak

Fixes #3634
This commit is contained in:
Norman Feske 2020-01-31 14:33:44 +01:00 committed by Christian Helmuth
parent 844af06782
commit a888041ba4
1 changed files with 4 additions and 1 deletions

View File

@ -399,9 +399,12 @@ struct Cached_fs_rom::Main final : Genode::Session_request_handler
} else if (!rom->transfer) {
File_system::File_handle handle = try_open(path);
try { new (heap) Transfer(transfers, *rom, fs, handle, rom->file_size); }
try {
new (heap) Transfer(transfers, *rom, fs, handle, rom->file_size);
}
catch (...) {
Genode::warning("defer transfer of ", rom->path);
fs.close(handle);
/* retry when next pending transfer completes */
return;
}