1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 08:35:09 +00:00

LibCore: Don't leak file descriptor inside AnonymousBuffer on Linux

This commit is contained in:
Jean-Baptiste Boric 2021-04-13 20:21:01 +02:00 committed by Andreas Kling
parent dcff87215b
commit c130161d9f

View file

@ -64,6 +64,7 @@ AnonymousBuffer AnonymousBuffer::create_with_size(size_t size)
return {};
}
if (ftruncate(fd, size) < 0) {
close(fd);
perror("ftruncate");
return {};
}