summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 21:29:53 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 21:29:53 +0000
commit2a6154f24863e3ab538ce12b86e4efa51d493a26 (patch)
tree00fa40a9ccc9e0f9e74027c3f4819489e34476a2
parent974105a6aece2943b6f1b07530bb42e3e975e4b5 (diff)
(diskfs_S_file_exec): Free initial reference created by
diskfs_make_protid.
-rw-r--r--libdiskfs/file-exec.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libdiskfs/file-exec.c b/libdiskfs/file-exec.c
index 7bbcdc69..d4970528 100644
--- a/libdiskfs/file-exec.c
+++ b/libdiskfs/file-exec.c
@@ -47,7 +47,8 @@ diskfs_S_file_exec (struct protid *cred,
{
struct node *np;
error_t err;
-
+ struct protid *newpi;
+
if (!cred)
return EOPNOTSUPP;
@@ -239,18 +240,19 @@ diskfs_S_file_exec (struct protid *cred,
flags |= EXEC_NEWTASK;
#endif
+ newpi = diskfs_make_protid (diskfs_make_peropen (np, O_READ,
+ cred->po->dotdotport),
+ cred->uids, cred->nuids,
+ cred->gids, cred->ngids);
err = exec_exec (diskfs_exec,
- (ports_get_right
- (diskfs_make_protid
- (diskfs_make_peropen (np, O_READ, cred->po->dotdotport),
- cred->uids, cred->nuids,
- cred->gids, cred->ngids))),
+ ports_get_right (newpi),
MACH_MSG_TYPE_MAKE_SEND,
task, flags, argv, argvlen, envp, envplen,
fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen,
intarray, intarraylen, deallocnames, deallocnameslen,
destroynames, destroynameslen);
+ ports_port_deref (newpi);
if (!err)
{
unsigned int i;