Fix coverity defects: CID 147548

CID 147548: Type:Dereference null return value

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn>
Closes #5321
This commit is contained in:
cao
2016-11-01 07:56:10 +08:00
committed by Brian Behlendorf
parent b182ac00aa
commit 2bac68145f
3 changed files with 7 additions and 5 deletions
+3 -2
View File
@@ -863,12 +863,13 @@ libzfs_init(void)
return (NULL);
}
hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "r");
hdl->libzfs_sharetab = fopen(ZFS_SHARETAB, "r");
if (libzfs_core_init() != 0) {
(void) close(hdl->libzfs_fd);
(void) fclose(hdl->libzfs_mnttab);
(void) fclose(hdl->libzfs_sharetab);
if (hdl->libzfs_sharetab)
(void) fclose(hdl->libzfs_sharetab);
free(hdl);
return (NULL);
}