diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-09-15 19:56:52 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-09-17 21:43:53 +0200 |
commit | 1efddaf1e5a8da0406f336c85491f2fd720d6860 (patch) | |
tree | a94127b8fd55c921da03337a4a31b7cb0f1be1c9 /OpenFilesScreen.c | |
parent | b096fdbfc093d06ba6d34dcad8a9f0efd47235f0 (diff) |
Check for fdopen failure in OpenFilesScreen_getProcessData
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r-- | OpenFilesScreen.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index 323913dd..915aba22 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -88,6 +88,10 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { OpenFiles_FileData* fdata = NULL; FILE* fd = fdopen(fdpair[0], "r"); + if (!fd) { + pdata->error = 1; + return pdata; + } for (;;) { char* line = String_readLine(fd); if (!line) { |