summaryrefslogtreecommitdiffstats
path: root/src/H5Groot.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-02-18 15:02:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-02-18 15:02:17 (GMT)
commit95223419fbb4232ba0b2cc42b3f7210db9ae4915 (patch)
treecaba948964b8e9c6986cf95fa6faec4dbdc62497 /src/H5Groot.c
parent0fb3254237255e8d145be86931c38ef77de02f78 (diff)
downloadhdf5-95223419fbb4232ba0b2cc42b3f7210db9ae4915.zip
hdf5-95223419fbb4232ba0b2cc42b3f7210db9ae4915.tar.gz
hdf5-95223419fbb4232ba0b2cc42b3f7210db9ae4915.tar.bz2
[svn-r18272] Description:
Bring r18271 from trunk to 1.8 branch: Clean up the file closing behavior a little more. Tested on: Mac OS X/32 10.6.2 (amazon) w/debug & production (too minor to require h5committest)
Diffstat (limited to 'src/H5Groot.c')
-rw-r--r--src/H5Groot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5Groot.c b/src/H5Groot.c
index 04f0e1a..0d21bfe 100644
--- a/src/H5Groot.c
+++ b/src/H5Groot.c
@@ -99,6 +99,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root)
H5G_loc_t root_loc; /* Root location information */
htri_t stab_exists = -1; /* Whether the symbol table exists */
hbool_t sblock_dirty = FALSE; /* Whether superblock was dirtied */
+ hbool_t path_init = FALSE; /* Whether path was initialized */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5G_mkroot, FAIL)
@@ -235,6 +236,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root)
/* Create the path names for the root group's entry */
H5G_name_init(root_loc.path, "/");
+ path_init = TRUE;
f->shared->root_grp->shared->fo_count = 1;
/* The only other open object should be the superblock extension, if it
@@ -250,7 +252,8 @@ done:
* allocated */
if(ret_value < 0) {
if(f->shared->root_grp) {
- H5G_name_free(root_loc.path);
+ if(path_init)
+ H5G_name_free(root_loc.path);
if(f->shared->root_grp->shared)
f->shared->root_grp->shared = H5FL_FREE(H5G_shared_t, f->shared->root_grp->shared);
f->shared->root_grp = H5FL_FREE(H5G_t, f->shared->root_grp);