Permalink
Browse files

Fix check against LXCROOTFSMOUNT to use strcmp

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>
  • Loading branch information...
1 parent eeb6cb8 commit 5bf2c5ce9ba2539efbf81928ef6ccb96d959bcf8 @stgraber stgraber committed Nov 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/lxc/conf.c
View
@@ -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

0 comments on commit 5bf2c5c

Please sign in to comment.