summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2018-10-10 01:25:41 +0530
committerAmar Tumballi <amarts@redhat.com>2018-10-16 06:33:09 +0000
commitfd70a7d790710da01a8ddd56785a28ab54e07550 (patch)
treeef1146e7d34c1eb3b186c2d763e983dadbb86913 /xlators
parent386f1d7926e4497fc2a905367ade2e3f6972eba7 (diff)
mount : fix high sev coverity issues in mount3.c
This patch fixes CID 1395067, 1388767 and 1395068. updates: bz#789278 Change-Id: Ie92252281bf559dd29fab462e121445ff4d3b865 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/nfs/server/src/mount3.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index f0d8aff999f..3d5be6a6a6b 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -2664,6 +2664,10 @@ mnt3_xlchildren_to_exports(rpcsvc_t *svc, struct mount3_state *ms)
if (!elist->ex_dir) {
gf_msg(GF_MNT, GF_LOG_ERROR, ENOMEM, NFS_MSG_NO_MEMORY,
"Memory allocation failed");
+ if (first == elist)
+ first = NULL;
+ xdr_free_exports_list(elist);
+ elist = NULL;
goto free_list;
}
strcpy(elist->ex_dir, ent->expname);
@@ -2712,7 +2716,7 @@ mnt3_xlchildren_to_exports(rpcsvc_t *svc, struct mount3_state *ms)
/* chain the groups together */
if (!elist->ex_groups)
elist->ex_groups = group;
- else if (!prev_group->gr_next)
+ else if (prev_group && !prev_group->gr_next)
prev_group->gr_next = group;
prev_group = group;
}