summaryrefslogtreecommitdiffstats
path: root/support/export/client.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-04-23 12:00:28 -0400
committerSteve Dickson <steved@redhat.com>2010-04-23 12:11:47 -0400
commit75cbc8d3fc9e7c3750629bd72519770ab58b868f (patch)
tree24304ed5907f40fe1897065f4a9c4ec81259ba85 /support/export/client.c
parent7fc6f6c6b68ba7fa1be6de05ce3b9e2d97b82ea4 (diff)
downloadnfs-utils-75cbc8d3fc9e7c3750629bd72519770ab58b868f.tar.gz
nfs-utils-75cbc8d3fc9e7c3750629bd72519770ab58b868f.tar.xz
nfs-utils-75cbc8d3fc9e7c3750629bd72519770ab58b868f.zip
libexport.a: Add client_free()
Clean up: Introduce a helper to free a nfs_client record. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/export/client.c')
-rw-r--r--support/export/client.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/support/export/client.c b/support/export/client.c
index 6a25928..859dcf1 100644
--- a/support/export/client.c
+++ b/support/export/client.c
@@ -52,6 +52,13 @@ init_addrlist(nfs_client *clp, const struct hostent *hp)
clp->m_naddr = i;
}
+static void
+client_free(nfs_client *clp)
+{
+ xfree(clp->m_hostname);
+ xfree(clp);
+}
+
/* if canonical is set, then we *know* this is already a canonical name
* so hostname lookup is avoided.
* This is used when reading /proc/fs/nfs/exports
@@ -209,8 +216,7 @@ client_freeall(void)
head = clientlist + i;
while (*head) {
*head = (clp = *head)->m_next;
- xfree(clp->m_hostname);
- xfree(clp);
+ client_free(clp);
}
}
}