summaryrefslogtreecommitdiff
path: root/libdiskfs/io-restrict-auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/io-restrict-auth.c')
-rw-r--r--libdiskfs/io-restrict-auth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdiskfs/io-restrict-auth.c b/libdiskfs/io-restrict-auth.c
index 011aa19e..80c0b208 100644
--- a/libdiskfs/io-restrict-auth.c
+++ b/libdiskfs/io-restrict-auth.c
@@ -41,6 +41,7 @@ diskfs_S_io_restrict_auth (struct protid *cred,
return err;
pthread_mutex_lock (&cred->po->np->lock);
+ refcount_ref (&cred->po->refcnt);
err = diskfs_create_protid (cred->po, user, &newpi);
if (! err)
{
@@ -48,6 +49,8 @@ diskfs_S_io_restrict_auth (struct protid *cred,
*newportpoly = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (newpi);
}
+ else
+ refcount_deref (&cred->po->refcnt);
pthread_mutex_unlock (&cred->po->np->lock);
iohelp_free_iouser (user);