]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroups: use zalloc
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 30 Jan 2021 01:07:36 +0000 (02:07 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 30 Jan 2021 11:02:09 +0000 (12:02 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index ad8410912fc975d8052e6eb91ab28584baf18d42..d4c111b21e2b854d60a93cbd8642bf424294279c 100644 (file)
@@ -3438,11 +3438,10 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf)
 {
        __do_free struct cgroup_ops *cgfsng_ops = NULL;
 
-       cgfsng_ops = malloc(sizeof(struct cgroup_ops));
+       cgfsng_ops = zalloc(sizeof(struct cgroup_ops));
        if (!cgfsng_ops)
                return ret_set_errno(NULL, ENOMEM);
 
-       memset(cgfsng_ops, 0, sizeof(struct cgroup_ops));
        cgfsng_ops->cgroup_layout = CGROUP_LAYOUT_UNKNOWN;
 
        if (cg_init(cgfsng_ops, conf))