From c130161d9f455d3b3900d09dc6296e1604b2df7c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Boric Date: Tue, 13 Apr 2021 20:21:01 +0200 Subject: LibCore: Don't leak file descriptor inside AnonymousBuffer on Linux --- Userland/Libraries/LibCore/AnonymousBuffer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Userland/Libraries/LibCore/AnonymousBuffer.cpp') diff --git a/Userland/Libraries/LibCore/AnonymousBuffer.cpp b/Userland/Libraries/LibCore/AnonymousBuffer.cpp index e30d229c7c..ef55f8bfdb 100644 --- a/Userland/Libraries/LibCore/AnonymousBuffer.cpp +++ b/Userland/Libraries/LibCore/AnonymousBuffer.cpp @@ -64,6 +64,7 @@ AnonymousBuffer AnonymousBuffer::create_with_size(size_t size) return {}; } if (ftruncate(fd, size) < 0) { + close(fd); perror("ftruncate"); return {}; } -- cgit v1.2.3