svn commit: r185440 - stable/7/sys/security/mac_bsdextended

Robert Watson rwatson at FreeBSD.org
Sat Nov 29 06:58:59 PST 2008


Author: rwatson
Date: Sat Nov 29 14:58:58 2008
New Revision: 185440
URL: http://svn.freebsd.org/changeset/base/185440

Log:
  Merge r184367 from head to stable/7:
  
    When the mac_bsdextended policy is unloaded, free rule memory.
  
    Obtained from:       TrustedBSD Project
  
  Approved by:	re (kensmith)

Modified:
  stable/7/sys/security/mac_bsdextended/mac_bsdextended.c

Modified: stable/7/sys/security/mac_bsdextended/mac_bsdextended.c
==============================================================================
--- stable/7/sys/security/mac_bsdextended/mac_bsdextended.c	Sat Nov 29 14:57:58 2008	(r185439)
+++ stable/7/sys/security/mac_bsdextended/mac_bsdextended.c	Sat Nov 29 14:58:58 2008	(r185440)
@@ -208,7 +208,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