Skip to content

Commit

Permalink
cgroup: trigger BUG if a mtype is unknown
Browse files Browse the repository at this point in the history
CID 1230179 (#1 of 1): Resource leak (RESOURCE_LEAK)
15. leaked_storage: Variable "ncd" going out of scope leaks the storage
it points to.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
  • Loading branch information
avagin authored and xemul committed Aug 7, 2014
1 parent 9ba0baa commit e601a2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag)
list_add_tail(&ncd->siblings, &current_controller->heads);
current_controller->n_heads++;
break;
default:
BUG();
}

INIT_LIST_HEAD(&ncd->children);
Expand Down

0 comments on commit e601a2e

Please sign in to comment.