summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boot/boot.c6
-rw-r--r--proc/mgt.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/boot/boot.c b/boot/boot.c
index db5c3964..f7c7d77f 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -1942,6 +1942,7 @@ S_mach_notify_new_task (mach_port_t notify,
goto fail;
assert (! MACH_PORT_VALID (previous));
+ mach_port_mod_refs (mach_task_self (), task, MACH_PORT_RIGHT_SEND, +1);
err = hurd_ihash_add (&task_ihash,
(hurd_ihash_key_t) task, (hurd_ihash_value_t) task);
if (err)
@@ -1951,9 +1952,10 @@ S_mach_notify_new_task (mach_port_t notify,
}
if (MACH_PORT_VALID (new_task_notification))
- /* Relay the notification. */
- mach_notify_new_task (new_task_notification, task, parent);
+ /* Relay the notification. This consumes task and parent. */
+ return mach_notify_new_task (new_task_notification, task, parent);
+ mach_port_deallocate (mach_task_self (), task);
mach_port_deallocate (mach_task_self (), parent);
return 0;
diff --git a/proc/mgt.c b/proc/mgt.c
index d572788e..8dc82f11 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -1082,8 +1082,8 @@ S_mach_notify_new_task (struct port_info *notify,
err = S_proc_child (parentp, task);
assert_perror (err);
- /* Relay the notification. */
- mach_notify_new_task (childp->p_task_namespace, task, parent);
+ /* Relay the notification. This consumes task and parent. */
+ return mach_notify_new_task (childp->p_task_namespace, task, parent);
}
mach_port_deallocate (mach_task_self (), task);