summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2006-11-08 22:16:46 +0000
committerHisham Muhammad <hisham@gobolinux.org>2006-11-08 22:16:46 +0000
commit97ea7a1a8c5f6356b1b961fca3dc7cc2cf10bfc4 (patch)
tree934b7f6923e260cdaae9495a423337789be358fe /ProcessList.c
parentadbfe82e6314031be3c35e2ba4d15b6f2fc416d9 (diff)
Ok, second take on fixing the handling of comm.-
Diffstat (limited to 'ProcessList.c')
-rw-r--r--ProcessList.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ProcessList.c b/ProcessList.c
index d2d67c3e..c3f0dc5a 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -526,10 +526,7 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
assert(process->pid == pid);
} else {
process = prototype;
- if (process->comm) {
- free(process->comm);
- process->comm = NULL;
- }
+ assert(process->comm == NULL);
process->pid = pid;
if (! ProcessList_readStatusFile(this, process, dirname, name))
goto errorReadingProcess;
@@ -611,6 +608,10 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
errorReadingProcess: {
if (existingProcess)
ProcessList_remove(this, process);
+ if (process->comm) {
+ free(process->comm);
+ process->comm = NULL;
+ }
}
}
}

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