diff --git a/src/lxc/cgroups/cgfs.c b/src/lxc/cgroups/cgfs.c index efd627f04..a6c26549e 100644 --- a/src/lxc/cgroups/cgfs.c +++ b/src/lxc/cgroups/cgfs.c @@ -555,7 +555,10 @@ static bool find_hierarchy_mountpts( struct cgroup_meta_data *meta_data, char ** } } - k = lxc_array_len((void **)h->all_mount_points); + if (h) + k = lxc_array_len((void **)h->all_mount_points); + else + k = 0; r = lxc_grow_array((void ***)&h->all_mount_points, &h->all_mount_point_capacity, k + 1, 4); if (r < 0) goto out;