X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/e8c3f78193f1895ea514044358b93b1add9322f3..b226f5e54a60dc81db17b1260381d7dbfea3cdf1:/osfmk/kern/task.c diff --git a/osfmk/kern/task.c b/osfmk/kern/task.c index c80e30d30..792daf7bc 100644 --- a/osfmk/kern/task.c +++ b/osfmk/kern/task.c @@ -6003,15 +6003,18 @@ task_set_mach_voucher( kern_return_t task_swap_mach_voucher( - task_t task, - ipc_voucher_t new_voucher, - ipc_voucher_t *in_out_old_voucher) + __unused task_t task, + __unused ipc_voucher_t new_voucher, + ipc_voucher_t *in_out_old_voucher) { - if (TASK_NULL == task) - return KERN_INVALID_TASK; - - *in_out_old_voucher = new_voucher; - return KERN_SUCCESS; + /* + * Currently this function is only called from a MIG generated + * routine which doesn't release the reference on the voucher + * addressed by in_out_old_voucher. To avoid leaking this reference, + * a call to release it has been added here. + */ + ipc_voucher_release(*in_out_old_voucher); + return KERN_NOT_SUPPORTED; } void task_set_gpu_denied(task_t task, boolean_t denied)