From 5189bf22c0dab83ac599834949159a11d5ea49dc Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sat, 22 Nov 2008 13:22:24 +0000 Subject: [PATCH] IFp4: Don't free pathname too soon, debugging code is still using it. --- .../contrib/opensolaris/uts/common/fs/zfs/spa_config.c | 9 ++++----- 1 file 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 1ffdb10dbfa5..c1af4656297b 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