fdopen: Check for malloc errors

This commit is contained in:
apio 2022-10-17 20:54:32 +02:00
parent e17a21dbad
commit 511ad67a9a

View File

@ -45,6 +45,7 @@ extern "C"
return 0;
}
FILE* stream = (FILE*)malloc(sizeof(FILE));
if (!stream) { return 0; }
stream->f_fd = fd;
clearerr(stream);
return stream;