coverity: #1425923

avoid NULL-pointer dereference Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 7e2624f3
...@@ -538,7 +538,10 @@ static bool find_hierarchy_mountpts( struct cgroup_meta_data *meta_data, char ** ...@@ -538,7 +538,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); r = lxc_grow_array((void ***)&h->all_mount_points, &h->all_mount_point_capacity, k + 1, 4);
if (r < 0) if (r < 0)
goto out; goto out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment