]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: avoid possible null deref
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 23 Jun 2014 13:41:49 +0000 (08:41 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 23 Jun 2014 13:41:49 +0000 (08:41 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 3d1cf34582f20c1a45c707bd167164b19bf094de..b8eacc1d7de17ffac75c8eb6a43d7a59f64bf62b 100644 (file)
@@ -2147,7 +2147,8 @@ static bool set_config_item_locked(struct lxc_container *c, const char *key, con
                c->lxc_conf = lxc_conf_init();
        if (!c->lxc_unexp_conf) {
                c->lxc_unexp_conf = lxc_conf_init();
-               c->lxc_unexp_conf->unexpanded = true;
+               if (c->lxc_unexp_conf)
+                       c->lxc_unexp_conf->unexpanded = true;
        }
        if (!c->lxc_conf || !c->lxc_unexp_conf)
                return false;