Skip to content

Commit

Permalink
restore: Simplify do_fork_with_pid() #2
Browse files Browse the repository at this point in the history
Move xfree() up

Signed-off-by: Kirill Tkhai <[email protected]>
Signed-off-by: Andrei Vagin <[email protected]>
  • Loading branch information
Kirill Tkhai authored and avagin committed Nov 29, 2017
1 parent 1fcb32b commit 2208c2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions criu/cr-restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,12 +1351,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();
Expand Down

0 comments on commit 2208c2a

Please sign in to comment.