mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
cgroup: fix potential null dereference
new_controller() returns NULL on error, so let's check for that. Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
44c4ef842d
commit
fe2073ee2e
1 changed files with 5 additions and 1 deletions
|
|
@ -567,7 +567,11 @@ static int collect_cgroups(struct list_head *ctls)
|
|||
pr_err("controller %s not found\n", cc->name);
|
||||
return -1;
|
||||
} else {
|
||||
struct cg_controller *nc = new_controller(cc->name);
|
||||
struct cg_controller *nc;
|
||||
|
||||
nc = new_controller(cc->name);
|
||||
if (!nc)
|
||||
return -1;
|
||||
list_add_tail(&nc->l, &cg->l);
|
||||
n_cgroups++;
|
||||
current_controller = nc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue