diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-25 13:05:01 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-28 13:13:32 +0100 |
commit | 78636c03a561d3a9a1b7c008dc390fe854196309 (patch) | |
tree | f531e1c24f3fa0e2f17e76636c02868a0aeef856 | |
parent | 88be9e7481f167d139b4f3c981368b6071c61384 (diff) |
init: fix port leak
* init/init.c (S_startup_essential_task): Fix port leak.
-rw-r--r-- | init/init.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c index de5dd6b6..b7b40bd2 100644 --- a/init/init.c +++ b/init/init.c @@ -1202,6 +1202,10 @@ S_startup_essential_task (mach_port_t server, static int authinit, procinit, execinit; int fail; + /* Always deallocate the extra reference this message carries. */ + if (MACH_PORT_VALID (credential)) + mach_port_deallocate (mach_task_self (), credential); + if (credential != host_priv) return EPERM; @@ -1209,8 +1213,6 @@ S_startup_essential_task (mach_port_t server, if (fail) return fail; - mach_port_deallocate (mach_task_self (), credential); - if (!booted) { if (!strcmp (name, "auth")) |