Hello,
Mikhail Karpov, le mer. 28 oct. 2026 13:49:04 +0700, a ecrit:
> diff --git a/libfshelp/translator-list.c b/libfshelp/translator-list.c
> index 6d4f941..ab62064 100644
> --- a/libfshelp/translator-list.c
> +++ b/libfshelp/translator-list.c
> @@ -129,13 +129,30 @@ fshelp_set_active_translator (struct port_info *pi,
> if (MACH_PORT_VALID (transbox->active) && transbox->active != t->active)
> {
> mach_port_t old;
> - err = mach_port_request_notification (mach_task_self (),
> transbox->active,
> + err = mach_port_request_notification (mach_task_self (),
> + transbox->active,
> MACH_NOTIFY_DEAD_NAME, 0,
> pi->port_right,
> MACH_MSG_TYPE_MAKE_SEND_ONCE,
> &old);
> if (err)
> goto out;
> +
> + err = mach_port_mod_refs (mach_task_self (), transbox->active,
> + MACH_PORT_RIGHT_SEND, +1);
> + if (err)
> + {
> + error_t request_err =
> + mach_port_request_notification (mach_task_self (),
> + transbox->active,
> + MACH_NOTIFY_DEAD_NAME, 0,
> + MACH_PORT_NULL,
> + MACH_MSG_TYPE_MAKE_SEND_ONCE,
> + &old);
> + assert_perror_backtrace (request_err);
I believe you'd have to deallocate the old port.
> + goto out;
> + }
> +
> if (MACH_PORT_VALID (old))
> mach_port_deallocate (mach_task_self (), old);
This also needs to be done anyway, even if err != 0.
Samuel