11221 beadm create can core dump on OpenSolaris due to bug in z_set_zone_root() Build124
authorEvan Layton <Evan.Layton@Sun.COM>
Thu, 24 Sep 2009 09:43:32 -0600
changeset 611 7662695ea106
parent 610 cad12cfc6c07
child 612 ee110b1b14d3
11221 beadm create can core dump on OpenSolaris due to bug in z_set_zone_root()
usr/src/lib/libinstzones/zones.c
--- a/usr/src/lib/libinstzones/zones.c	Wed Sep 23 00:54:55 2009 -0600
+++ b/usr/src/lib/libinstzones/zones.c	Thu Sep 24 09:43:32 2009 -0600
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -1232,9 +1232,9 @@
 	}
 
 	/* free any existing cached root path */
-
 	if (*_z_global_data._z_root_dir != '\0') {
 		free(_z_global_data._z_root_dir);
+		_z_global_data._z_root_dir = NULL;
 	}
 
 	/* store duplicate of new zone root path */
@@ -1242,7 +1242,7 @@
 	if (*rootdir != '\0') {
 		_z_global_data._z_root_dir = _z_strdup(rootdir);
 	} else {
-		*_z_global_data._z_root_dir = '\0';
+		_z_global_data._z_root_dir = "";
 	}
 
 	/* set zone root path */