diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2006-11-08 22:08:00 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2006-11-08 22:08:00 +0000 |
commit | 45fab61da316392f6c375498293aa4c990cd75d2 (patch) | |
tree | e379c6d0bbb4da6db83ef346312d83ff09d2c7a1 | |
parent | 8adc7ac00f60016e24651366d43a0f5b4f72c0cb (diff) |
Avoid double free of prototype's comm.
-rw-r--r-- | ProcessList.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ProcessList.c b/ProcessList.c index b6c65d27..9552aaca 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -526,7 +526,10 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl assert(process->pid == pid); } else { process = prototype; - process->comm = NULL; + if (process->comm) { + free(process->comm); + process->comm = NULL; + } process->pid = pid; if (! ProcessList_readStatusFile(this, process, dirname, name)) goto errorReadingProcess; @@ -608,9 +611,6 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl errorReadingProcess: { if (existingProcess) ProcessList_remove(this, process); - else { - if (process->comm) - free(process->comm); } } } |