[CRIU] [PATCH 03/14] restore: Simplify do_fork_with_pid() #2
Kirill Tkhai
ktkhai at virtuozzo.com
Mon May 15 06:05:02 PDT 2017
Move xfree() up
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/cr-restore.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 966a759b6..9a4732d77 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1292,12 +1292,12 @@ static int do_fork_with_pid(struct pstree_item *item, struct ns_id *pid_ns, stru
if (hlp_pid->ns[i].virt < 0)
hlp_pid->ns[i].virt = INIT_PID + 1;
}
- if (set_next_pid(pid_ns->parent, hlp_pid) < 0) {
+ ret = set_next_pid(pid_ns->parent, hlp_pid);
+ xfree(hlp_pid);
+ if (ret) {
pr_err("Can't set next pid\n");
- xfree(hlp_pid);
return -1;
}
- xfree(hlp_pid);
if (ca->clone_flags & CLONE_FILES)
close_pid_proc();
More information about the CRIU
mailing list