Skip to content
This repository
Browse code

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...
commit 5bf2c5ce9ba2539efbf81928ef6ccb96d959bcf8 1 parent eeb6cb8
Stéphane Graber authored November 12, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  src/lxc/conf.c
2  src/lxc/conf.c
@@ -2576,7 +2576,7 @@ void lxc_conf_free(struct lxc_conf *conf)
2576 2576
 		return;
2577 2577
 	if (conf->console.path)
2578 2578
 		free(conf->console.path);
2579  
-	if (conf->rootfs.mount != LXCROOTFSMOUNT)
  2579
+	if (strcmp(conf->rootfs.mount, LXCROOTFSMOUNT) != 0)
2580 2580
 		free(conf->rootfs.mount);
2581 2581
 	lxc_clear_config_network(conf);
2582 2582
 #if HAVE_APPARMOR

0 notes on commit 5bf2c5c

Please sign in to comment.
Something went wrong with that request. Please try again.