svn commit: r184367 - head/sys/security/mac_bsdextended

Robert Watson rwatson at FreeBSD.org
Mon Oct 27 11:08:13 PDT 2008


Author: rwatson
Date: Mon Oct 27 18:08:12 2008
New Revision: 184367
URL: http://svn.freebsd.org/changeset/base/184367

Log:
  When the mac_bsdextended policy is unloaded, free rule memory.
  
  Obtained from:	TrustedBSD Project
  MFC after:	3 days

Modified:
  head/sys/security/mac_bsdextended/mac_bsdextended.c

Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c
==============================================================================
--- head/sys/security/mac_bsdextended/mac_bsdextended.c	Mon Oct 27 18:05:26 2008	(r184366)
+++ head/sys/security/mac_bsdextended/mac_bsdextended.c	Mon Oct 27 18:08:12 2008	(r184367)
@@ -214,7 +214,12 @@ ugidfw_init(struct mac_policy_conf *mpc)
 static void
 ugidfw_destroy(struct mac_policy_conf *mpc)
 {
+	int i;
 
+	for (i = 0; i < MAC_BSDEXTENDED_MAXRULES; i++) {
+		if (rules[i] != NULL)
+			free(rules[i], M_MACBSDEXTENDED);
+	}
 	mtx_destroy(&ugidfw_mtx);
 }
 


More information about the svn-src-all mailing list