summaryrefslogtreecommitdiffstats
path: root/rpc/xdr
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/xdr')
-rw-r--r--rpc/xdr/src/xdr-nfs3.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/rpc/xdr/src/xdr-nfs3.c b/rpc/xdr/src/xdr-nfs3.c
index 0e145fc9954..01ccb236993 100644
--- a/rpc/xdr/src/xdr-nfs3.c
+++ b/rpc/xdr/src/xdr-nfs3.c
@@ -1836,6 +1836,19 @@ xdr_exportnode (XDR *xdrs, exportnode *objp)
return TRUE;
}
+static void
+xdr_free_groupnode (struct groupnode *group)
+{
+ if (!group)
+ return;
+
+ if (group->gr_next)
+ xdr_free_groupnode (group->gr_next);
+
+ GF_FREE (group->gr_name);
+ GF_FREE (group);
+}
+
void
xdr_free_exports_list (struct exportnode *first)
{
@@ -1848,10 +1861,7 @@ xdr_free_exports_list (struct exportnode *first)
elist = first->ex_next;
GF_FREE (first->ex_dir);
- if (first->ex_groups) {
- GF_FREE (first->ex_groups->gr_name);
- GF_FREE (first->ex_groups);
- }
+ xdr_free_groupnode (first->ex_groups);
GF_FREE (first);
first = elist;