Skip to content

fix(os): popen handle leak and exit-code parse crash (B4, A8)#32

Merged
dsent merged 1 commit into
aldum:devfrom
Vadim1987:Vadim1987/fix-os-popen-leak-and-exit
Jun 30, 2026
Merged

fix(os): popen handle leak and exit-code parse crash (B4, A8)#32
dsent merged 1 commit into
aldum:devfrom
Vadim1987:Vadim1987/fix-os-popen-leak-and-exit

Conversation

@Vadim1987

Copy link
Copy Markdown

B4: test_popen ran io.popen('echo') via pcall but never closed the returned handle, leaking one per call. Capture and close it. A8: runcmd_with_exit did result:find("(%d+)%s*$") - 1, which throws when the output has no trailing digits (nil - 1). Capture the position once, return failure if absent, and drop the redundant second find.

@dsent
dsent requested a review from aldum June 30, 2026 02:41
@dsent
dsent merged commit 1a92810 into aldum:dev Jun 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants