summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proc/info.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/proc/info.c b/proc/info.c
index 445fcd8b..11625442 100644
--- a/proc/info.c
+++ b/proc/info.c
@@ -426,7 +426,11 @@ S_proc_getprocinfo (struct proc *callerp,
{
err = errno;
if (*flags & PI_FETCH_THREADS)
- munmap (thds, nthreads * sizeof (thread_t));
+ {
+ for (i = 0; i < nthreads; i++)
+ mach_port_deallocate (mach_task_self (), thds[i]);
+ munmap (thds, nthreads * sizeof (thread_t));
+ }
return err;
}
pi_alloced = 1;