diff options
-rw-r--r-- | libtrivfs/file-reparent.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libtrivfs/file-reparent.c b/libtrivfs/file-reparent.c index c07fbccb..0682a912 100644 --- a/libtrivfs/file-reparent.c +++ b/libtrivfs/file-reparent.c @@ -27,5 +27,8 @@ trivfs_S_file_reparent (struct trivfs_protid *cred, mach_port_t *new, mach_msg_type_name_t *new_type) { /* This is not a directory, so we just duplicate it */ - return trivfs_S_io_duplicate (cred, reply, reply_type, new, new_type); + error_t ret = trivfs_S_io_duplicate (cred, reply, reply_type, new, new_type); + if (!ret) + mach_port_deallocate (mach_task_self (), parent); + return ret; } |