[libc] Handle allocation failures gracefully in FILE related API.
authorSiva Chandra Reddy <sivachandra@google.com>
Thu, 22 Dec 2022 00:36:59 +0000 (00:36 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Thu, 22 Dec 2022 19:30:16 +0000 (19:30 +0000)
commitd06308df8bb098921a9eb519185410c400c3acb6
treea09b77c052ecc4e6bec30558740ffaddd90ac556
parent27839e1e171a8e60f9c9f34bc4e80951670f915b
[libc] Handle allocation failures gracefully in FILE related API.

Few uses of free have not yet been replaced by the custom operator
delete yet. They will be done in a follow up patch.

Reviewed By: lntue, michaelrj

Differential Revision: https://reviews.llvm.org/D140526
libc/src/__support/File/CMakeLists.txt
libc/src/__support/File/file.cpp
libc/src/__support/File/file.h
libc/src/__support/File/linux_file.cpp
libc/src/stdio/CMakeLists.txt
libc/src/stdio/fopencookie.cpp
libc/test/src/__support/File/CMakeLists.txt
libc/test/src/__support/File/file_test.cpp