diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-07-21 21:35:33 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-07-21 21:35:33 +0000 |
commit | 0f09e0dbce3947d90f44b3c9fff0ef4efa8b235a (patch) | |
tree | de5918fef6f9fdec3998f09a52b6713b041faa5a | |
parent | f0fe80fffa93f0b87b12aeea487d0ff1b4736695 (diff) |
(diskfs_S_io_duplicate): Free initial reference created by
diskfs_make_protid.
-rw-r--r-- | libdiskfs/io-duplicate.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libdiskfs/io-duplicate.c b/libdiskfs/io-duplicate.c index 38eb8087..d64dc600 100644 --- a/libdiskfs/io-duplicate.c +++ b/libdiskfs/io-duplicate.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994 Free Software Foundation + Copyright (C) 1994, 1995 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -24,14 +24,17 @@ diskfs_S_io_duplicate (struct protid *cred, mach_port_t *port, mach_msg_type_name_t *portpoly) { + struct protid *newpi; + if (!cred) return EOPNOTSUPP; mutex_lock (&cred->po->np->lock); - *port = (ports_get_right - (diskfs_make_protid - (cred->po, cred->uids, cred->nuids, cred->gids, cred->ngids))); + newpi = diskfs_make_protid (cred->po, cred->uids, cred->nuids, + cred->gids, cred->ngids); + *port = ports_get_right (newpi); *portpoly = MACH_MSG_TYPE_MAKE_SEND; + ports_port_deref (newpi); mutex_unlock (&cred->po->np->lock); return 0; } |