]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix check against LXCROOTFSMOUNT to use strcmp
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 12 Nov 2012 19:39:43 +0000 (14:39 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 12 Nov 2012 19:39:43 +0000 (14:39 -0500)
The check for conf->rootfs.mount not being equal to LXCROOTFSMOUNT
wasn't done with strcmp which was leading to undefined behaviour
and triggered gcc warnings.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/conf.c

index f3c2334bf4dcebd88ed8180c8f5f94d13fe31035..96f2cf792883f3f92f59aedae13e56c65832982c 100644 (file)
@@ -2576,7 +2576,7 @@ void lxc_conf_free(struct lxc_conf *conf)
                return;
        if (conf->console.path)
                free(conf->console.path);
-       if (conf->rootfs.mount != LXCROOTFSMOUNT)
+       if (strcmp(conf->rootfs.mount, LXCROOTFSMOUNT) != 0)
                free(conf->rootfs.mount);
        lxc_clear_config_network(conf);
 #if HAVE_APPARMOR