diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-07-21 21:39:11 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-07-21 21:39:11 +0000 |
commit | 0d2d9672157cff4d2882a97d26adab0dcd539025 (patch) | |
tree | 376b9bdb9a61ccfc935238de11c2dc98346e30eb /libdiskfs | |
parent | 2fb4e44466f31851094aad409eb74ebced6925f6 (diff) |
(_diskfs_translator_callback_fn): Free initial reference created by
diskfs_make_protid.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/trans-callback.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libdiskfs/trans-callback.c b/libdiskfs/trans-callback.c index 98e77b7d..0c2e438c 100644 --- a/libdiskfs/trans-callback.c +++ b/libdiskfs/trans-callback.c @@ -32,6 +32,7 @@ _diskfs_translator_callback_fn (void *cookie1, void *cookie2, struct node *np = cookie1; mach_port_t *dotdot = cookie2; error_t err; + struct protid *newpi; if (!np->istranslated) return ENOENT; @@ -43,15 +44,17 @@ _diskfs_translator_callback_fn (void *cookie1, void *cookie2, *uid = np->dn_stat.st_uid; *gid = np->dn_stat.st_gid; - *underlying = (ports_get_right - (diskfs_make_protid - (diskfs_make_peropen (np, - (O_READ|O_EXEC - | (diskfs_readonly ? O_WRITE : 0)), - *dotdot), - uid, 1, gid, 1))); + newpi = diskfs_make_protid (diskfs_make_peropen (np, + (O_READ|O_EXEC + | (diskfs_readonly + ? O_WRITE : 0)), + *dotdot), + uid, 1, gid, 1); + + *underlying = ports_get_right (newpi); mach_port_insert_right (mach_task_self (), *underlying, *underlying, MACH_MSG_TYPE_MAKE_SEND); + ports_port_deref (newpi); return 0; } |