libexport.a: Add client_free() From: Chuck Lever Clean up: Introduce a helper to free a nfs_client record. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- support/export/client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- nfs-utils-1.2.1.orig/support/export/client.c +++ nfs-utils-1.2.1/support/export/client.c @@ -52,6 +52,13 @@ init_addrlist(nfs_client *clp, const str 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); } } }