summaryrefslogtreecommitdiffstats
path: root/OpenFilesScreen.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2010-03-03 21:10:51 +0000
committerHisham Muhammad <hisham@gobolinux.org>2010-03-03 21:10:51 +0000
commit282f16c4b8df9fb5bac6c7952afe5b49c1b4dd11 (patch)
treeeab96d002b89860d9af4d212f3463fb76f9adfb9 /OpenFilesScreen.c
parenta600d5a6e92cbeb13926c7cca623ee81711b5399 (diff)
fix memory leak
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') {

© 2014-2024 Faster IT GmbH | imprint | privacy policy