diff options
author | Richard Yao <[email protected]> | 2022-09-23 19:55:26 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-23 16:55:26 -0700 |
commit | ebe1d0361671c80025d5be2c31131ed223115873 (patch) | |
tree | 04f6b7e5a3af21a543afe7d4afa4465908cd4a29 /cmd/zhack.c | |
parent | 2a493a4c7127258b14c39e8c71a9d6f01167c5cd (diff) |
Fix userland resource leaks
Coverity caught these. With the exception of the file descriptor leak in
tests/zfs-tests/cmd/draid.c, they are all memory leaks.
Also, there is a piece of dead code in zfs_get_enclosure_sysfs_path().
We delete it as cleanup.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #13921
Diffstat (limited to 'cmd/zhack.c')
-rw-r--r-- | cmd/zhack.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/zhack.c b/cmd/zhack.c index 75d9c93b3..8797a53e4 100644 --- a/cmd/zhack.c +++ b/cmd/zhack.c @@ -295,6 +295,8 @@ zhack_do_feature_enable(int argc, char **argv) feature.fi_flags |= ZFEATURE_FLAG_READONLY_COMPAT; break; case 'd': + if (desc != NULL) + free(desc); desc = strdup(optarg); break; default: |