summaryrefslogtreecommitdiff
path: root/libdiskfs/dir-mkfile.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 21:27:58 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 21:27:58 +0000
commit974105a6aece2943b6f1b07530bb42e3e975e4b5 (patch)
tree41931b61d25de0c8bb4dc7b3f4aecb2ef5504224 /libdiskfs/dir-mkfile.c
parentcecb0e759a20dd2f1c9dd8c6de7e726bbee695de (diff)
(diskfs_S_dir_mkfile): Free initial reference created by
diskfs_make_protid.
Diffstat (limited to 'libdiskfs/dir-mkfile.c')
-rw-r--r--libdiskfs/dir-mkfile.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libdiskfs/dir-mkfile.c b/libdiskfs/dir-mkfile.c
index 6e3ac61f..ef8b58d8 100644
--- a/libdiskfs/dir-mkfile.c
+++ b/libdiskfs/dir-mkfile.c
@@ -33,7 +33,8 @@ diskfs_S_dir_mkfile (struct protid *cred,
{
struct node *dnp, *np;
error_t err;
-
+ struct protid *newpi;
+
if (!cred)
return EOPNOTSUPP;
if (diskfs_readonly)
@@ -67,12 +68,14 @@ diskfs_S_dir_mkfile (struct protid *cred,
return err;
flags &= (O_READ | O_WRITE | O_EXEC);
- *newnode = (ports_get_right
- (diskfs_make_protid
- (diskfs_make_peropen (np, flags, cred->po->dotdotport),
- cred->uids, cred->nuids,
- cred->gids, cred->ngids)));
+ newpi = diskfs_make_protid (diskfs_make_peropen (np, flags,
+ cred->po->dotdotport),
+ cred->uids, cred->nuids,
+ cred->gids, cred->ngids);
+
+ *newnode = ports_get_right (newpi);
*newnodetype = MACH_MSG_TYPE_MAKE_SEND;
+ ports_port_deref (newpi);
diskfs_nput (np);
return 0;
}