summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 21:33:57 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 21:33:57 +0000
commitf0fe80fffa93f0b87b12aeea487d0ff1b4736695 (patch)
tree7b9e293eafd1bc6e4a5cf14bbd33437c9e62fe94 /libdiskfs
parentfc23d8f2d657c682037023b1f1642109307f4d2a (diff)
(diskfs_S_fsys_getroot): Free initial reference created by
diskfs_make_protid.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/fsys-getroot.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libdiskfs/fsys-getroot.c b/libdiskfs/fsys-getroot.c
index 8b4eb4a5..a7492ed0 100644
--- a/libdiskfs/fsys-getroot.c
+++ b/libdiskfs/fsys-getroot.c
@@ -45,6 +45,7 @@ diskfs_S_fsys_getroot (fsys_t controlport,
error_t error = 0;
mode_t type;
struct protid pseudocred;
+ struct protid *newpi;
if (!pt)
return EOPNOTSUPP;
@@ -159,14 +160,15 @@ diskfs_S_fsys_getroot (fsys_t controlport,
flags &= ~OPENONLY_STATE_MODES;
+ newpi = diskfs_make_protid (diskfs_make_peropen (diskfs_root_node,
+ flags, dotdot),
+ uids, nuids, gids, ngids);
*retry = FS_RETRY_NORMAL;
*retryname = '\0';
- *returned_port = (ports_get_right
- (diskfs_make_protid
- (diskfs_make_peropen (diskfs_root_node, flags, dotdot),
- uids, nuids, gids, ngids)));
+ *returned_port = ports_get_right (newpi);
*returned_port_poly = MACH_MSG_TYPE_MAKE_SEND;
-
+ ports_port_deref (newpi);
+
mutex_unlock (&diskfs_root_node->lock);
ports_port_deref (pt);