]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
libexport.a: Add client_free()
authorChuck Lever <chuck.lever@oracle.com>
Fri, 23 Apr 2010 16:00:28 +0000 (12:00 -0400)
committerSteve Dickson <steved@redhat.com>
Fri, 23 Apr 2010 16:11:47 +0000 (12:11 -0400)
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>
support/export/client.c

index 6a2592808f0a7e7c7b02aef0f394de1a46b474fa..859dcf1771dfdea480106d7b256cb5131d989e97 100644 (file)
@@ -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);
                }
        }
 }