Skip to content

memory leak when using :breakdel with an expression - #21960

Open
hudsonzuo wants to merge 2 commits into
vim:masterfrom
hudsonzuo:18236_memleak_breakdel
Open

hudsonzuo wants to merge 2 commits into
vim:masterfrom
hudsonzuo:18236_memleak_breakdel

Conversation

@hudsonzuo

@hudsonzuo hudsonzuo commented Nov 17, 2026 •

Copy link
Copy Markdown

Problem: When ":breakdel" parses its argument, dbg_parsearg() stores the
evaluated expression in the temporary breakpoint entry's
"dbg_val", but only "dbg_name" is freed afterwards, leaking the
typval and the value it holds. (issue #18236)
Solution: Also free "dbg_val" when the breakpoint type is DBG_EXPR.

closes: #18236

Assisted-by: GLM5

AI assistance

  • AI involvement is disclosed in the commit message
  • No AI was used

Checklist

  • The commit message follows the Problem/Solution form above
  • Signed-off-by: trailer is present (git commit -s), recommended but not required

Tests

  • Tests were added
  • Existing tests cover the change
  • The change cannot be tested (explain below)

Documentation

  • Documentation under runtime/doc/ was updated
  • No documentation update is needed

Anything reviewers should know

Problem:  When ":breakdel" parses its argument, dbg_parsearg() stores the
          evaluated expression in the temporary breakpoint entry's
          "dbg_val", but only "dbg_name" is freed afterwards, leaking the
          typval and the value it holds. (issue vim#18236)
Solution: Also free "dbg_val" when the breakpoint type is DBG_EXPR.

closes: vim#18236

Assisted-by: GLM5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in function ex_breakdel in debugger.c.

1 participant