diff options
author | cao <[email protected]> | 2016-10-13 02:16:47 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-10-12 11:16:47 -0700 |
commit | 06cf4d989058a65f72b140d85e2c21effd3b3834 (patch) | |
tree | 0720a7c874084e577e2aad3baa8767c198ec9f60 /lib/libzfs | |
parent | af4db70f368d0e9c9ad90f0837a77e511a77b0a7 (diff) |
Fix coverity defects: CID 147606, 147609
coverity scan CID:147606, Type:resource leak
coverity scan CID:147609, Type:resource leak
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: cao.xuewen <[email protected]>
Closes #5245
Diffstat (limited to 'lib/libzfs')
-rw-r--r-- | lib/libzfs/libzfs_pool.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 112221674..68cc5f3ee 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -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; |