fix: memory leak due to forced termination during startup

Change-Id: Ide519f01702bfd17ae4576e04806b6d155ae846a
refs: #1397
This commit is contained in:
TOIDA,Suguru
2019-11-25 12:11:36 +09:00
committed by Masamichi Takagi
parent 93581cb142
commit 9e2196c9ce
9 changed files with 318 additions and 18 deletions

View File

@@ -1407,14 +1407,21 @@ void terminate(int rc, int sig)
}
void
terminate_host(int pid)
terminate_host(int pid, struct thread *thread)
{
struct process *proc;
struct mcs_rwlock_node_irqsave lock;
proc = find_process(pid, &lock);
if(!proc)
if (!proc) {
if (thread) {
proc = thread->proc;
ihk_atomic_set(&thread->refcount, 1);
release_thread(thread);
release_process(proc);
}
return;
}
if (proc->nohost != 1) {
proc->nohost = 1;