mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 10:19:03 +03:00
LibCore: Don't leak file descriptor inside AnonymousBuffer on Linux
This commit is contained in:
parent
dcff87215b
commit
c130161d9f
Notes:
sideshowbarker
2024-07-18 20:25:00 +09:00
Author: https://github.com/boricj Commit: https://github.com/SerenityOS/serenity/commit/c130161d9f4 Pull-request: https://github.com/SerenityOS/serenity/pull/6295
@ -64,6 +64,7 @@ AnonymousBuffer AnonymousBuffer::create_with_size(size_t size)
|
||||
return {};
|
||||
}
|
||||
if (ftruncate(fd, size) < 0) {
|
||||
close(fd);
|
||||
perror("ftruncate");
|
||||
return {};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user