Actions
Bug #5207
closedMemory leak in "zfs-diagnosis" (fmd)
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
lib - userland libraries
Start date:
2014-10-03
Due date:
% Done:
0%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:
Description
I saw very fast mem leak on a host and after researching core-dump of fmd i prepared the following patch
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 ba1f276..8fbf630 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 @@ -294,17 +294,18 @@ zpool_find_load_time(zpool_handle_t *zhp, void *arg) uint64_t *tod; nvlist_t *config; uint_t nelem; + int rc = 0; if (lta->lt_found) - return (0); + goto out; pool_guid = zpool_get_prop_int(zhp, ZPOOL_PROP_GUID, NULL); if (pool_guid != lta->lt_guid) - return (0); + goto out; if ((config = zpool_get_config(zhp, NULL)) == NULL) { - zpool_close(zhp); - return (-1); + rc = -1; + goto out; } if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_LOADED_TIME, @@ -314,7 +315,9 @@ zpool_find_load_time(zpool_handle_t *zhp, void *arg) lta->lt_time->ertv_nsec = tod[1]; } - return (0); +out: + zpool_close(zhp); + return (rc); } static void
Related issues
Actions