summaryrefslogtreecommitdiff
path: root/libfshelp/fetch-control.c
diff options
context:
space:
mode:
Diffstat (limited to 'libfshelp/fetch-control.c')
-rw-r--r--libfshelp/fetch-control.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libfshelp/fetch-control.c b/libfshelp/fetch-control.c
index 32b28ddf..26c12d88 100644
--- a/libfshelp/fetch-control.c
+++ b/libfshelp/fetch-control.c
@@ -25,6 +25,7 @@ fshelp_fetch_control (struct transbox *box,
mach_port_t *control)
{
*control = box->active;
- mach_port_mod_refs (mach_task_self (), *control, MACH_PORT_RIGHT_SEND, 1);
+ if (*control != MACH_PORT_NULL)
+ mach_port_mod_refs (mach_task_self (), *control, MACH_PORT_RIGHT_SEND, 1);
return 0;
}