summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libports/get-right.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libports/get-right.c b/libports/get-right.c
index dd7f5b6a..308123a3 100644
--- a/libports/get-right.c
+++ b/libports/get-right.c
@@ -29,7 +29,13 @@ ports_get_right (void *port)
mach_port_t foo;
mutex_lock (&_ports_lock);
-
+
+ if (pi->port_right == MACH_PORT_NULL)
+ {
+ mutex_unlock (&_ports_lock);
+ return MACH_PORT_NULL;
+ }
+
pi->mscount++;
if ((pi->flags & PORT_HAS_SENDRIGHTS) == 0)
{