mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #13921
This commit is contained in:
+4
-1
@@ -7395,8 +7395,11 @@ unshare_unmount(int op, int argc, char **argv)
|
||||
((tree = uu_avl_create(pool, NULL, UU_DEFAULT)) == NULL))
|
||||
nomem();
|
||||
|
||||
if ((mnttab = fopen(MNTTAB, "re")) == NULL)
|
||||
if ((mnttab = fopen(MNTTAB, "re")) == NULL) {
|
||||
uu_avl_destroy(tree);
|
||||
uu_avl_pool_destroy(pool);
|
||||
return (ENOENT);
|
||||
}
|
||||
|
||||
while (getmntent(mnttab, &entry) == 0) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user