Fix memory leak when a child exits without wait()-ed
Change-Id: I8ad9e20e3f3e6f406548a6c4de2bf4dc07c40b0e Refs: #1349
This commit is contained in:
committed by
Masamichi Takagi
parent
1d1ec39a27
commit
b3cbdeec84
@@ -1346,8 +1346,8 @@ void terminate(int rc, int sig)
|
||||
|
||||
if (child->ppid_parent == proc &&
|
||||
child->status == PS_ZOMBIE) {
|
||||
list_del(&child->hash_list);
|
||||
list_del(&child->siblings_list);
|
||||
list_del_init(&child->hash_list);
|
||||
list_del_init(&child->siblings_list);
|
||||
free_child = 1;
|
||||
}
|
||||
else if (child->ppid_parent == proc) {
|
||||
@@ -1377,7 +1377,7 @@ void terminate(int rc, int sig)
|
||||
&updatelock);
|
||||
|
||||
if (free_child)
|
||||
kfree(child);
|
||||
release_process(child);
|
||||
}
|
||||
mcs_rwlock_writer_unlock(&resource_set->process_hash->lock[i],
|
||||
&lock);
|
||||
|
||||
Reference in New Issue
Block a user