Skip to content

Conversation

@jzeuzs
Copy link
Owner

@jzeuzs jzeuzs commented Nov 21, 2025

Windows

The thread_amount function calls CreateToolhelp32Snapshot but fails to close the returned HANDLE using CloseHandle. Repeated calls to this function will cause the handle count of the process to grow indefinitely, eventually leading to system instability or process termination when the handle limit is reached.

macOS / iOS

The thread_amount function calls task_threads (via Mach kernel APIs) which allocates memory for the thread list. The function fails to deallocate this memory using vm_deallocate. Repeated calls will result in a steady memory leak, eventually causing the process to be killed by the OOM (Out of Memory) killer.

@jzeuzs jzeuzs merged commit 28860d4 into main Nov 21, 2025
8 checks passed
@jzeuzs jzeuzs deleted the memory-leak-windows-macos branch November 21, 2025 17:37
@jzeuzs jzeuzs added Priority: Critical Issues that must be fixed or PRs that must be finished and merged with maximum priority. SEM: Patch PRs that contain bugfixes and should be released in the next patch version. Type: Security Pull requests that address a security vulnerability labels Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Critical Issues that must be fixed or PRs that must be finished and merged with maximum priority. SEM: Patch PRs that contain bugfixes and should be released in the next patch version. Type: Security Pull requests that address a security vulnerability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant