I'm about to add a second bit of logic that needs to free all
mountlist records, so introduce a helper for freeing them.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
xfunlock(lockid);
}
+static void
+mountlist_freeall(mountlist list)
+{
+ while (list != NULL) {
+ mountlist m = list;
+ list = m->ml_next;
+ xfree(m->ml_hostname);
+ xfree(m->ml_directory);
+ xfree(m);
+ }
+}
+
mountlist
mountlist_list(void)
{
return NULL;
}
if (stb.st_mtime != last_mtime) {
- while (mlist) {
- mlist = (m = mlist)->ml_next;
- xfree(m->ml_hostname);
- xfree(m->ml_directory);
- xfree(m);
- }
+ mountlist_freeall(mlist);
last_mtime = stb.st_mtime;
setrmtabent("r");