Revision
22998
Author
zarzycki@apple.com
Date
2007-01-02 10:32:46 -0800 (Tue, 02 Jan 2007)

Log Message

Fix a Mach port leak.

Modified Paths

Diff

Modified: trunk/launchd/src/launchd_core_logic.c (22997 => 22998)


--- trunk/launchd/src/launchd_core_logic.c	2006-12-22 19:44:52 UTC (rev 22997)
+++ trunk/launchd/src/launchd_core_logic.c	2007-01-02 18:32:46 UTC (rev 22998)
@@ -613,10 +613,9 @@
 		job_assumes(j, launchd_mport_close_recv(j->j_port) == KERN_SUCCESS);
 	}
 
-#if 0
-	if (j->wait_reply_port) {
+	if (!job_assumes(j, j->wait_reply_port == MACH_PORT_NULL)) {
+		job_assumes(j, launchd_mport_deallocate(j->wait_reply_port) == KERN_SUCCESS);
 	}
-#endif
 
 	while ((sg = SLIST_FIRST(&j->sockets))) {
 		socketgroup_delete(j, sg);