From 77ad21c2d3a5780bc71184423de9b20f977fa293 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 22 Jul 1995 16:57:48 +0000 Subject: Formerly socket.c.~14~ --- pflocal/socket.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pflocal/socket.c b/pflocal/socket.c index a45bb475..10736281 100644 --- a/pflocal/socket.c +++ b/pflocal/socket.c @@ -30,9 +30,19 @@ error_t S_socket_connect2 (struct sock_user *user1, struct sock_user *user2) { + error_t err; + if (!user1 || !user2) return EOPNOTSUPP; - return sock_connect (user1->sock, user2->sock); + + err = sock_connect (user1->sock, user2->sock); + + /* Since USER2 isn't in the receiver position in the rpc, we get a send + right for it (although we only use the receive right with the same + name); be sure it's deallocated! */ + mach_port_deallocate (mach_task_self (), user2->pi.port_right); + + return err; } /* Make sure we have a queue to listen on. */ -- cgit v1.2.3