From 2a6154f24863e3ab538ce12b86e4efa51d493a26 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 21 Jul 1995 21:29:53 +0000 Subject: (diskfs_S_file_exec): Free initial reference created by diskfs_make_protid. --- libdiskfs/file-exec.c | 14 ++++++++------ 1 file 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; -- cgit v1.2.3