Skip to content

Fix control chain leak#6

Merged
lmdiazangulo merged 2 commits intodevfrom
fix-control-chain-leak
May 8, 2026
Merged

Fix control chain leak#6
lmdiazangulo merged 2 commits intodevfrom
fix-control-chain-leak

Conversation

@lmdiazangulo
Copy link
Copy Markdown

No description provided.

lmdiazangulo and others added 2 commits March 14, 2025 12:40
Every call to cp_evloop() via ngSpice_Command() appended a new
struct control node to the control[stackp] linked chain but the
executed nodes were never freed. Over thousands of command calls
(e.g. repeated 'alter' commands in MTLN co-simulation) the chain
grew without bound, leaking ~4 KB per step.

After executing a top-level block (co_parent == NULL), free the
entire chain via ctl_free(control[stackp]) and reset the pointers.
The comment '/* va: TODO: free old structure ... */' in the same
function acknowledged this gap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lmdiazangulo lmdiazangulo requested a review from Alberto-o May 6, 2026 09:07
@lmdiazangulo lmdiazangulo merged commit 730b251 into dev May 8, 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.

2 participants