From 69a6f7175eaa5e5a2a38a92e6e522062e898f570 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Fri, 9 Jan 2015 19:32:54 +0100 Subject: 5519 zfs-diagnosis: Memory leak in zpool_find_load_time() Reviewed by: Dan Fields Reviewed by: Matthew Ahrens Reviewed by: Serghei Samsi Approved by: Dan McDonald --- usr/src/cmd/fm/modules/common/zfs-diagnosis/zfs_de.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'usr/src/cmd') 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); } -- cgit v1.2.3