summaryrefslogtreecommitdiff
path: root/libdiskfs/dir-lookup.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 21:26:32 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 21:26:32 +0000
commitcecb0e759a20dd2f1c9dd8c6de7e726bbee695de (patch)
treed8a208b1f97d92747dab2f9dd9bd0dcd59552c4e /libdiskfs/dir-lookup.c
parentbe8a4d7be366c1cb093eee7cdf3f19c39375ba35 (diff)
(diskfs_S_dir_lookup): Free initial references created by
diskfs_make_protid.
Diffstat (limited to 'libdiskfs/dir-lookup.c')
-rw-r--r--libdiskfs/dir-lookup.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index 540b159f..bac87859 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -48,6 +48,7 @@ diskfs_S_dir_lookup (struct protid *dircred,
int mustbedir = 0;
int amt;
int type;
+ struct protid *newpi;
if (!dircred)
return EOPNOTSUPP;
@@ -173,15 +174,16 @@ diskfs_S_dir_lookup (struct protid *dircred,
&& (np->istranslated || fshelp_translated (&np->transbox)))
{
mach_port_t dirport;
-
+
/* Create an unauthenticated port for DNP, and then
unlock it. */
- dirport = (ports_get_right
- (diskfs_make_protid
- (diskfs_make_peropen (dnp, 0, dircred->po->dotdotport),
- 0, 0, 0, 0)));
+ newpi = diskfs_make_protid (diskfs_make_peropen (dnp, 0,
+ dircred->po->dotdotport),
+ 0, 0, 0, 0);
+ dirport = ports_get_right (newpi);
mach_port_insert_right (mach_task_self (), dirport, dirport,
MACH_MSG_TYPE_MAKE_SEND);
+ ports_port_deref (newpi);
if (np != dnp)
mutex_unlock (&dnp->lock);
@@ -341,12 +343,12 @@ diskfs_S_dir_lookup (struct protid *dircred,
flags &= ~OPENONLY_STATE_MODES;
- *returned_port = (ports_get_right
- (diskfs_make_protid
- (diskfs_make_peropen (np, flags, dircred->po->dotdotport),
- dircred->uids, dircred->nuids,
- dircred->gids, dircred->ngids)));
-
+ newpi = diskfs_make_protid (diskfs_make_peropen (np, flags,
+ dircred->po->dotdotport),
+ dircred->uids, dircred->nuids,
+ dircred->gids, dircred->ngids);
+ *returned_port = ports_get_right (newpi);
+ ports_port_deref (newpi);
out:
if (np)