summaryrefslogtreecommitdiff
path: root/pfinet/misc.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-05-14 19:12:33 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-05-14 19:12:33 +0000
commit15d8720b53f2d1a9516414fa826dfeb44f3786b6 (patch)
tree6dfd194e6b6ddcab2449b1e4531e88a74237c26a /pfinet/misc.c
parentb57fad22c148ccfb8848822d550b5f8c6b9febbf (diff)
(sock_alloc): Initialize SOCK->identity.
(sock_release): Destroy SOCK->identity if it's been set.
Diffstat (limited to 'pfinet/misc.c')
-rw-r--r--pfinet/misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pfinet/misc.c b/pfinet/misc.c
index 1beed39e..b1cf519b 100644
--- a/pfinet/misc.c
+++ b/pfinet/misc.c
@@ -128,6 +128,7 @@ sock_alloc (void)
waitp = (void *)wait + sizeof (struct wait_queue);
bzero (sock, sizeof (struct socket));
+ sock->identity = MACH_PORT_NULL;
sock->state = SS_UNCONNECTED;
sock->wait = waitp;
@@ -174,6 +175,9 @@ sock_release (struct socket *sock)
(*sock->ops->release) (sock, peersock);
if (peersock)
sock_release_peer(peersock);
+
+ if (sock->identity != MACH_PORT_NULL)
+ mach_port_destroy (mach_task_self (), sock->identity);
free (sock);
}