Check for fdopen failure in OpenFilesScreen_getProcessData

This commit is contained in:
Christian Göttsche 2020-09-15 19:56:52 +02:00 committed by cgzones
parent b096fdbfc0
commit 1efddaf1e5
1 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,10 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
OpenFiles_FileData* fdata = NULL; OpenFiles_FileData* fdata = NULL;
FILE* fd = fdopen(fdpair[0], "r"); FILE* fd = fdopen(fdpair[0], "r");
if (!fd) {
pdata->error = 1;
return pdata;
}
for (;;) { for (;;) {
char* line = String_readLine(fd); char* line = String_readLine(fd);
if (!line) { if (!line) {