diff options
author | Marcel Telka <marcel.telka@nexenta.com> | 2015-01-09 19:32:54 +0100 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2015-01-14 10:32:22 -0500 |
commit | 69a6f7175eaa5e5a2a38a92e6e522062e898f570 (patch) | |
tree | abd73c5d51bd37a4338435e9a716cf90c17bef6a | |
parent | 0d435d6202242b0a06dc4bc41a1117591a9405f8 (diff) | |
download | illumos-joyent-69a6f7175eaa5e5a2a38a92e6e522062e898f570.tar.gz |
5519 zfs-diagnosis: Memory leak in zpool_find_load_time()
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serghei Samsi <sscdvp@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
-rw-r--r-- | usr/src/cmd/fm/modules/common/zfs-diagnosis/zfs_de.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr/src/cmd/fm/modules/common/zfs-diagnosis/zfs_de.c b/usr/src/cmd/fm/modules/common/zfs-diagnosis/zfs_de.c index ab9a5fad9f..d1206a34d3 100644 --- a/usr/src/cmd/fm/modules/common/zfs-diagnosis/zfs_de.c +++ b/usr/src/cmd/fm/modules/common/zfs-diagnosis/zfs_de.c @@ -18,7 +18,9 @@ * * CDDL HEADER END */ + /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. */ @@ -292,12 +294,16 @@ zpool_find_load_time(zpool_handle_t *zhp, void *arg) nvlist_t *config; uint_t nelem; - if (lta->lt_found) + if (lta->lt_found) { + zpool_close(zhp); return (0); + } pool_guid = zpool_get_prop_int(zhp, ZPOOL_PROP_GUID, NULL); - if (pool_guid != lta->lt_guid) + if (pool_guid != lta->lt_guid) { + zpool_close(zhp); return (0); + } if ((config = zpool_get_config(zhp, NULL)) == NULL) { zpool_close(zhp); @@ -311,6 +317,8 @@ zpool_find_load_time(zpool_handle_t *zhp, void *arg) lta->lt_time->ertv_nsec = tod[1]; } + zpool_close(zhp); + return (0); } |