fix(#3196): utils.read_file may hold onto fd
Signed-off-by: Natalie Sepruko <me@sepruko.dev>
This commit is contained in:
parent
fefa335f1c
commit
b01dc99f85
@ -26,6 +26,7 @@ function M.read_file(path)
|
|||||||
end
|
end
|
||||||
local stat = vim.loop.fs_fstat(fd)
|
local stat = vim.loop.fs_fstat(fd)
|
||||||
if not stat then
|
if not stat then
|
||||||
|
vim.loop.fs_close(fd)
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
local data = vim.loop.fs_read(fd, stat.size, 0)
|
local data = vim.loop.fs_read(fd, stat.size, 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user