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:
cao
2016-10-13 02:16:47 +08:00
committed by Brian Behlendorf
parent af4db70f36
commit 06cf4d9890
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -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;