diff options
author | pjd <pjd@FreeBSD.org> | 2008-11-22 13:22:24 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2008-11-22 13:22:24 +0000 |
commit | 62c46ed65096d0e91837748910972a428aeb3b26 (patch) | |
tree | 206c37d23103b76fd446c65113e9e2c6c2d13873 | |
parent | 371d0216fb21251f9f5b42ed163852c5b93816f1 (diff) | |
download | FreeBSD-src-62c46ed65096d0e91837748910972a428aeb3b26.zip FreeBSD-src-62c46ed65096d0e91837748910972a428aeb3b26.tar.gz |
IFp4: Don't free pathname too soon, debugging code is still using it.
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c index 1ffdb10..c1af465 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c @@ -88,11 +88,9 @@ spa_config_load(void) file = kobj_open_file(pathname); - kmem_free(pathname, MAXPATHLEN); - if (file == (struct _buf *)-1) { ZFS_LOG(1, "Cannot open %s.", pathname); - return; + goto out; } if (kobj_get_filesize(file, &fsize) != 0) { @@ -146,10 +144,11 @@ spa_config_load(void) nvlist_free(nvlist); out: + kmem_free(pathname, MAXPATHLEN); if (buf != NULL) kmem_free(buf, fsize); - - kobj_close_file(file); + if (file != (struct _buf *)-1) + kobj_close_file(file); } static void |