mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 16:05:06 +00:00
LibCore: Don't leak file descriptor inside AnonymousBuffer on Linux
This commit is contained in:
parent
dcff87215b
commit
c130161d9f
1 changed files with 1 additions and 0 deletions
|
@ -64,6 +64,7 @@ AnonymousBuffer AnonymousBuffer::create_with_size(size_t size)
|
|||
return {};
|
||||
}
|
||||
if (ftruncate(fd, size) < 0) {
|
||||
close(fd);
|
||||
perror("ftruncate");
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue