do not cleanup exec in cleanup pod

Let pts loop or signal loop do the cleanup job. fix the
possible double free of exec.

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
Gao feng
2015-10-23 21:58:48 +08:00
parent ae5338bde5
commit 18abe7d9e1
3 changed files with 9 additions and 2 deletions
+7
View File
@@ -631,6 +631,13 @@ void hyper_cleanup_container(struct hyper_pod *pod)
}
free(c->maps);
close(c->ns);
free(c->exec.id);
for (i = 0; i < c->exec.argc; i++) {
//fprintf(stdout, "argv %d %s\n", i, exec->argv[i]);
free(c->exec.argv[i]);
}
free(c->exec.argv);
}
free(pod->c);
+2 -1
View File
@@ -637,7 +637,7 @@ int hyper_send_exec_eof(int to, struct hyper_pod *pod,
return 0;
}
/*
void hyper_cleanup_exec(struct hyper_pod *pod)
{
struct hyper_exec *exec, *next;
@@ -647,3 +647,4 @@ void hyper_cleanup_exec(struct hyper_pod *pod)
hyper_release_exec(exec, pod);
}
}
*/
-1
View File
@@ -938,7 +938,6 @@ static void hyper_cleanup_shared(struct hyper_pod *pod)
void hyper_cleanup_pod(struct hyper_pod *pod)
{
hyper_cleanup_exec(pod);
hyper_cleanup_container(pod);
hyper_cleanup_network(pod);
hyper_cleanup_shared(pod);