summaryrefslogtreecommitdiffstats
path: root/OpenFilesScreen.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r--OpenFilesScreen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c
index 2b047593..df67f127 100644
--- a/OpenFilesScreen.c
+++ b/OpenFilesScreen.c
@@ -91,7 +91,10 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(int pid) {
break;
anyRead = true;
char* entry = malloc(1024);
- if (!fgets(entry, 1024, fd)) break;
+ if (!fgets(entry, 1024, fd)) {
+ free(entry);
+ break;
+ }
char* newline = strrchr(entry, '\n');
*newline = '\0';
if (cmd == 'f') {