mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Fix coverity defects: CID 147606, 147609
coverity scan CID:147606, Type:resource leak coverity scan CID:147609, Type:resource leak Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn> Closes #5245
This commit is contained in:
parent
af4db70f36
commit
06cf4d9890
@ -6281,8 +6281,11 @@ ztest_run(ztest_shared_t *zs)
|
||||
kthread_t *thread;
|
||||
|
||||
if (t < ztest_opts.zo_datasets &&
|
||||
ztest_dataset_open(t) != 0)
|
||||
ztest_dataset_open(t) != 0) {
|
||||
umem_free(tid,
|
||||
ztest_opts.zo_threads * sizeof (kt_did_t));
|
||||
return;
|
||||
}
|
||||
|
||||
VERIFY3P(thread = zk_thread_create(NULL, 0,
|
||||
(thread_func_t)ztest_thread,
|
||||
|
@ -4159,7 +4159,7 @@ zpool_label_name(char *label_name, int label_size)
|
||||
int fd;
|
||||
|
||||
fd = open("/dev/urandom", O_RDONLY);
|
||||
if (fd > 0) {
|
||||
if (fd >= 0) {
|
||||
if (read(fd, &id, sizeof (id)) != sizeof (id))
|
||||
id = 0;
|
||||
|
||||
|
@ -108,6 +108,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
j++;
|
||||
}
|
||||
(void) close(fd);
|
||||
} else if (pid == 0) {
|
||||
int fd = open(dirpath, O_RDONLY);
|
||||
int chownret;
|
||||
@ -128,6 +129,7 @@ main(int argc, char **argv)
|
||||
|
||||
k++;
|
||||
}
|
||||
(void) close(fd);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user