summaryrefslogtreecommitdiff
path: root/libdiskfs/io-restrict-auth.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 21:37:01 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 21:37:01 +0000
commit2fb4e44466f31851094aad409eb74ebced6925f6 (patch)
tree99c8dbdd839408829ad46842b5180aef8ae0bd1d /libdiskfs/io-restrict-auth.c
parent0f09e0dbce3947d90f44b3c9fff0ef4efa8b235a (diff)
(diskfs_S_io_restrict_auth): Free initial referenc created by
diskfs_make_protid.
Diffstat (limited to 'libdiskfs/io-restrict-auth.c')
-rw-r--r--libdiskfs/io-restrict-auth.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libdiskfs/io-restrict-auth.c b/libdiskfs/io-restrict-auth.c
index 0cd15792..3565e4e2 100644
--- a/libdiskfs/io-restrict-auth.c
+++ b/libdiskfs/io-restrict-auth.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994 Free Software Foundation
+ Copyright (C) 1994, 1995 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -41,6 +41,7 @@ diskfs_S_io_restrict_auth (struct protid *cred,
{
uid_t *newuids, *newgids;
int i, newnuids, newngids;
+ struct protid *newpi;
if (!cred)
return EOPNOTSUPP;
@@ -56,10 +57,10 @@ diskfs_S_io_restrict_auth (struct protid *cred,
newgids[newngids++] = cred->gids[i];
mutex_lock (&cred->po->np->lock);
- *newport = (ports_get_right
- (diskfs_make_protid (cred->po, newuids, newnuids, newgids,
- newngids)));
+ newpi = diskfs_make_protid (cred->po, newuids, newnuids, newgids, newngids);
+ *newport = ports_get_right (newpi);
mutex_unlock (&cred->po->np->lock);
*newportpoly = MACH_MSG_TYPE_MAKE_SEND;
+ ports_port_deref (newpi);
return 0;
}