summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/api.c b/api.c
index 68eea8a..a6918a8 100644
--- a/api.c
+++ b/api.c
@@ -891,6 +891,10 @@ struct cgroup *cgroup_get_cgroup(struct cgroup *cgroup)
}
closedir(dir);
}
+ /* Check if the group really exists or not */
+ if (!cgroup->index)
+ goto unlock_error;
+
pthread_rwlock_unlock(&cg_mount_table_lock);
return cgroup;