From 974105a6aece2943b6f1b07530bb42e3e975e4b5 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 21 Jul 1995 21:27:58 +0000 Subject: (diskfs_S_dir_mkfile): Free initial reference created by diskfs_make_protid. --- libdiskfs/dir-mkfile.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'libdiskfs') 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; } -- cgit v1.2.3