diff options
Diffstat (limited to 'xlators/nfs')
-rw-r--r-- | xlators/nfs/server/src/mount3.c | 6 |
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; } |