PERFORCE change 105370 for review

Todd Miller millert at FreeBSD.org
Wed Aug 30 21:29:17 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=105370

Change 105370 by millert at millert_g4tower on 2006/08/30 21:28:38

	Fix port label memory leak introduced by @4676.  Now that
	the port label is initialized in ipc_object_alloc() we don't
	need to do it (again) in ipc_port_init().  We *do*, however,
	need to init the port label in ipc_port_alloc_special(),
	since that doesn't go through the normal ipc_object_alloc()
	code path (kernel ports are special).

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_port.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_port.c#3 (text+ko) ====

@@ -471,10 +471,6 @@
 #endif	/* MACH_ASSERT */
 
 	ipc_mqueue_init(&port->ip_messages, FALSE /* set */);
-
-#ifdef MAC
-	mac_port_init_label (&port->ip_label);
-#endif
 }
 
 /*
@@ -1153,7 +1149,7 @@
 	 * we will use a new entry point for this purpose, as current_task()
 	 * is often wrong (i.e. not kernel_task) or null.
 	 */
-
+	mac_port_init_label(&port->ip_label);
 	mac_port_create_kernel(&port->ip_label, space == ipc_space_reply);
 #endif
 


More information about the trustedbsd-cvs mailing list