[lxc-devel] [lxc/master] cgroup: check for non-empty conf

brauner on Github lxc-bot at linuxcontainers.org
Wed Jul 10 14:35:27 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190710/05b06627/attachment.bin>
-------------- next part --------------
From d926acfde0b5225efa7d3261275af119be1529a6 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Wed, 10 Jul 2019 16:34:29 +0200
Subject: [PATCH] cgroup: check for non-empty conf

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/cgroups/cgroup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c
index bf92bf2985..5443bd9611 100644
--- a/src/lxc/cgroups/cgroup.c
+++ b/src/lxc/cgroups/cgroup.c
@@ -44,6 +44,11 @@ struct cgroup_ops *cgroup_init(struct lxc_conf *conf)
 {
 	struct cgroup_ops *cgroup_ops;
 
+	if (!conf) {
+		ERROR("No valid conf given");
+		return NULL;
+	}
+
 	cgroup_ops = cgfsng_ops_init(conf);
 	if (!cgroup_ops) {
 		ERROR("Failed to initialize cgroup driver");


More information about the lxc-devel mailing list