From d775d7de4b3b8f085d54c7b21595eecfc2fd43df Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 21 Jul 1995 21:02:31 +0000 Subject: (trivfs_handle_port): Free initial reference created by ports_allocate_port. --- libtrivfs/handle-port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libtrivfs/handle-port.c') diff --git a/libtrivfs/handle-port.c b/libtrivfs/handle-port.c index 6f51ccb9..cd3a43b7 100644 --- a/libtrivfs/handle-port.c +++ b/libtrivfs/handle-port.c @@ -25,6 +25,7 @@ trivfs_handle_port (mach_port_t realnode, struct port_bucket *protid_bucket) { struct trivfs_control *cntl; + mach_port_t right; cntl = ports_allocate_port (control_bucket, sizeof (struct trivfs_control), control_class); @@ -32,5 +33,7 @@ trivfs_handle_port (mach_port_t realnode, cntl->protid_class = protid_class; cntl->protid_bucket = protid_bucket; mutex_init (&cntl->lock); - return ports_get_right (cntl); + right = ports_get_right (cntl); + ports_port_deref (cntl); + return right; } -- cgit v1.2.3