Module: wine Branch: master Commit: 2ffcce16cb3a580a58cc9504ae375f8ec0033a22 URL: https://gitlab.winehq.org/wine/wine/-/commit/2ffcce16cb3a580a58cc9504ae375f8...
Author: Tim Clem tclem@codeweavers.com Date: Mon Aug 8 10:07:23 2022 -0700
ntdll: Fix leak of mach_host_self port.
---
dlls/ntdll/unix/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 902b63c2b2f..83e0521a3c9 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2624,8 +2624,9 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, { processor_cpu_load_info_data_t *pinfo; mach_msg_type_number_t info_count; + host_name_port_t host = mach_host_self ();
- if (host_processor_info( mach_host_self (), + if (host_processor_info( host, PROCESSOR_CPU_LOAD_INFO, &cpus, (processor_info_array_t*)&pinfo, @@ -2641,6 +2642,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, } vm_deallocate (mach_task_self (), (vm_address_t) pinfo, info_count * sizeof(natural_t)); } + + mach_port_deallocate (mach_task_self (), host); } #elif defined(linux) {