summaryrefslogtreecommitdiffstats
path: root/lib/libshare/nfs.c
diff options
context:
space:
mode:
authorcao <[email protected]>2016-10-25 04:37:38 +0800
committerBrian Behlendorf <[email protected]>2016-10-24 13:37:38 -0700
commitaed0e9f3e4db75f4b622e1f0623fe61a94a43dc2 (patch)
tree6b1fd020e9d46cc6847ff328490bb3e7a4fac493 /lib/libshare/nfs.c
parent13d9a004fe533df8613888687650b1b0e272b67d (diff)
Fix coverity defects: CID 147511, 147513
CID 147511: Type:Dereference before null check CID 147513: Type:Dereference before null check Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5306
Diffstat (limited to 'lib/libshare/nfs.c')
-rw-r--r--lib/libshare/nfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libshare/nfs.c b/lib/libshare/nfs.c
index 58b4c8880..9d548dccc 100644
--- a/lib/libshare/nfs.c
+++ b/lib/libshare/nfs.c
@@ -532,8 +532,10 @@ nfs_is_share_active(sa_share_impl_t impl_share)
nfs_exportfs_temp_fp = fdopen(fd, "r");
- if (nfs_exportfs_temp_fp == NULL ||
- fseek(nfs_exportfs_temp_fp, 0, SEEK_SET) < 0) {
+ if (nfs_exportfs_temp_fp == NULL)
+ return (B_FALSE);
+
+ if (fseek(nfs_exportfs_temp_fp, 0, SEEK_SET) < 0) {
fclose(nfs_exportfs_temp_fp);
return (B_FALSE);
}