Commit 45fab61d authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Avoid double free of prototype's comm.

parent 8adc7ac0
...@@ -526,7 +526,10 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl ...@@ -526,7 +526,10 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
assert(process->pid == pid); assert(process->pid == pid);
} else { } else {
process = prototype; process = prototype;
if (process->comm) {
free(process->comm);
process->comm = NULL; process->comm = NULL;
}
process->pid = pid; process->pid = pid;
if (! ProcessList_readStatusFile(this, process, dirname, name)) if (! ProcessList_readStatusFile(this, process, dirname, name))
goto errorReadingProcess; goto errorReadingProcess;
...@@ -608,9 +611,6 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl ...@@ -608,9 +611,6 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
errorReadingProcess: { errorReadingProcess: {
if (existingProcess) if (existingProcess)
ProcessList_remove(this, process); ProcessList_remove(this, process);
else {
if (process->comm)
free(process->comm);
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment