From 0f09e0dbce3947d90f44b3c9fff0ef4efa8b235a Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 21 Jul 1995 21:35:33 +0000 Subject: (diskfs_S_io_duplicate): Free initial reference created by diskfs_make_protid. --- libdiskfs/io-duplicate.c | 11 +++++++---- 1 file 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; } -- cgit v1.2.3