소스 검색

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

Jean-Baptiste Boric 4 년 전
부모
커밋
c130161d9f
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      Userland/Libraries/LibCore/AnonymousBuffer.cpp

+ 1 - 0
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 {};
     }