summaryrefslogtreecommitdiff
path: root/libdiskfs/io-duplicate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/io-duplicate.c')
-rw-r--r--libdiskfs/io-duplicate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdiskfs/io-duplicate.c b/libdiskfs/io-duplicate.c
index 45c4df5d..a2e568b7 100644
--- a/libdiskfs/io-duplicate.c
+++ b/libdiskfs/io-duplicate.c
@@ -32,6 +32,7 @@ diskfs_S_io_duplicate (struct protid *cred,
pthread_mutex_lock (&cred->po->np->lock);
+ refcount_ref (&cred->po->refcnt);
err = diskfs_create_protid (cred->po, cred->user, &newpi);
if (! err)
{
@@ -39,6 +40,8 @@ diskfs_S_io_duplicate (struct protid *cred,
*portpoly = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (newpi);
}
+ else
+ refcount_deref (&cred->po->refcnt);
pthread_mutex_unlock (&cred->po->np->lock);