From 569467f8a4165d7c79811934f7fe899e48bd96cd Mon Sep 17 00:00:00 2001 From: Bret Lambert Date: Mon, 20 Oct 2008 13:40:20 +0000 Subject: Be pedantically correct in freeing allocated mbufs, even upon clearing the server cache on shutdown. ok thib@ --- sys/nfs/nfs_srvcache.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c index 9edc8cc4e53..26939c5af54 100644 --- a/sys/nfs/nfs_srvcache.c +++ b/sys/nfs/nfs_srvcache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_srvcache.c,v 1.19 2008/07/05 12:45:06 thib Exp $ */ +/* $OpenBSD: nfs_srvcache.c,v 1.20 2008/10/20 13:40:19 blambert Exp $ */ /* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */ /* @@ -291,6 +291,10 @@ nfsrv_cleancache(void) nextrp = TAILQ_NEXT(rp, rc_lru); LIST_REMOVE(rp, rc_hash); TAILQ_REMOVE(&nfsrvlruhead, rp, rc_lru); + if (rp->rc_flag & RC_REPMBUF) + m_freem(rp->rc_reply); + if (rp->rc_flag & RC_NAM) + m_freem(rp->rc_nam); free(rp, M_NFSD); } numnfsrvcache = 0; -- cgit v1.2.3