[vim/vim] dict_add_func: balance funcref count on dict_add() failure (PR #20742)

0 views
Skip to first unread message

mattn

unread,
Jul 10, 2026, 1:44:39 PM (yesterday) Jul 10
to vim/vim, Subscribed

dict_add_func() calls func_ref() only after dict_add() succeeds, but on the failure path dictitem_free() calls func_unref() on the name. For a lambda or numbered function that is an unref without a matching ref, corrupting its reference count. Take the reference before dict_add() so the failure path stays balanced.

related: #20668


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20742

Commit Summary

  • 286083f dict_add_func: balance funcref count on dict_add() failure

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20742@github.com>

Reply all
Reply to author
Forward
0 new messages