diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2006-11-08 21:49:52 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2006-11-08 21:49:52 +0000 |
commit | 8adc7ac00f60016e24651366d43a0f5b4f72c0cb (patch) | |
tree | 5fd547096023374cc7b1be9cc855ddbd532e8ec6 | |
parent | 27131192494e069cdbbea8abc933b11d82cda21e (diff) |
Fix asserts, don't use freed memory.
-rw-r--r-- | ProcessList.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ProcessList.c b/ProcessList.c index 255a57a3..b6c65d27 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -309,12 +309,12 @@ void ProcessList_remove(ProcessList* this, Process* p) { assert(Vector_indexOf(this->processes, p, Process_pidCompare) != -1); assert(Hashtable_get(this->processTable, p->pid) != NULL); Process* pp = Hashtable_remove(this->processTable, p->pid); - assert(pp == p); + assert(pp == p); (void)pp; + int pid = p->pid; int index = Vector_indexOf(this->processes, p, Process_pidCompare); assert(index != -1); Vector_remove(this->processes, index); - assert(Vector_indexOf(this->processes, p, Process_pidCompare) == -1); - assert(Hashtable_get(this->processTable, p->pid) == NULL); + assert(Hashtable_get(this->processTable, pid) == NULL); (void)pid; } Process* ProcessList_get(ProcessList* this, int index) { |