[CRIU] [PATCH] cgroup: trigger BUG if a mtype is unknown

Andrey Vagin avagin at openvz.org
Wed Aug 6 07:14:29 PDT 2014


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 at openvz.org>
---
 cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cgroup.c b/cgroup.c
index 06311e4..6a222a8 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -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);
-- 
1.8.5.3



More information about the CRIU mailing list