From 5bf2c5ce9ba2539efbf81928ef6ccb96d959bcf8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Mon, 12 Nov 2012 14:39:43 -0500 Subject: [PATCH] Fix check against LXCROOTFSMOUNT to use strcmp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/lxc/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index f3c2334bf..96f2cf792 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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 -- 2.47.2