From 562a6fcca0308f83863b43a02283072c80a5c23f Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Sun, 1 Mar 2015 09:46:01 -0600 Subject: [PATCH] Fix mach kernal deallocations --- proctl/proctl_darwin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proctl/proctl_darwin.c b/proctl/proctl_darwin.c index 3a643bfc..5140e89f 100644 --- a/proctl/proctl_darwin.c +++ b/proctl/proctl_darwin.c @@ -68,7 +68,7 @@ get_threads(task_t task, void *slice) { memcpy(slice, (void*)list, count*sizeof(list[0])); - kret = vm_deallocate(task, (vm_address_t) &list, count * sizeof(list[0])); + kret = vm_deallocate(mach_task_self(), (vm_address_t) list, count * sizeof(list[0])); if (kret != KERN_SUCCESS) return kret; return (kern_return_t)0; @@ -83,7 +83,7 @@ thread_count(task_t task) { kret = task_threads(task, &list, &count); if (kret != KERN_SUCCESS) return -1; - kret = vm_deallocate(task, (vm_address_t) &list, count * sizeof(list[0])); + kret = vm_deallocate(mach_task_self(), (vm_address_t) list, count * sizeof(list[0])); if (kret != KERN_SUCCESS) return -1; return count;