aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/mountd
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2009-06-23 21:48:04 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2009-06-23 21:48:04 +0000
commit73f4ccbd29840a18a1df5a5c301f2a0a6e1083ef (patch)
tree9cc886b2a5aeee213a992ed75615037582aaa47f /usr.sbin/mountd
parent96c5d068d8e78a4ab287f773cb3f9b61f0815851 (diff)
When mountd.c parses the nfsv4 root line(s) in /etc/exports, it
allocates data structures that are never linked into the tree or free'd. As such, mountd would leak memory every time it parsed an nfsv4 root line. This patch frees up those structures to plug the leak. Approved by: kib (mentor)
Notes
Notes: svn path=/head/; revision=194773
Diffstat (limited to 'usr.sbin/mountd')
-rw-r--r--usr.sbin/mountd/mountd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index b6ca3cd32e6f..6fcb88447910 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -1414,8 +1414,20 @@ get_exportlist_one()
/*
* For V4: don't enter in mount lists.
*/
- if (v4root_phase > 0 && v4root_phase <= 2)
+ if (v4root_phase > 0 && v4root_phase <= 2) {
+ /*
+ * Since these structures aren't used by mountd,
+ * free them up now.
+ */
+ if (ep != NULL)
+ free_exp(ep);
+ while (tgrp != NULL) {
+ grp = tgrp;
+ tgrp = tgrp->gr_next;
+ free_grp(grp);
+ }
goto nextline;
+ }
/*
* Success. Update the data structures.