fdopen: Check for malloc errors
This commit is contained in:
parent
e17a21dbad
commit
511ad67a9a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user