chiark / gitweb /
core: corrects check of strduped controller string
authorNestor Ovroy <novroy@riseup.net>
Thu, 17 Jan 2013 13:55:30 +0000 (05:55 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Jan 2013 14:31:50 +0000 (09:31 -0500)
In commit 246aa6d (core: add bus API and systemctl commands for altering
cgroup parameters during runtime), when rewriting unit_add_one_default_cgroup
to prefered style, the check of strduped b->controller was incorrectly
changed to check the containing structure. Correct it.

src/core/unit.c

index 1194c524bfdc77f8fa2a840165fafdfe55fc0c2f..d26f6e456c1dcfb5a451b2a495eee0357e561059 100644 (file)
@@ -2090,7 +2090,7 @@ static int unit_add_one_default_cgroup(Unit *u, const char *controller) {
                 return -ENOMEM;
 
         b->controller = strdup(controller);
-        if (!b)
+        if (!b->controller)
                 goto fail;
 
         b->path = unit_default_cgroup_path(u);