[vim/vim] Avoid unnecessary memory allocation in set_callback() (PR #19831)

3 views
Skip to first unread message

Shane Harper

unread,
Mar 26, 2026, 3:57:16 AM (yesterday) Mar 26
to vim/vim, Subscribed

Problem: set_callback() could duplicate the callback name when the original string could still be used.
Solution: Don't duplicate the callback name when the original string is already owned by the callback.


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

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

Commit Summary

  • 23dfcbe Avoid unnecessary memory allocation in set_callback().
  • 59333f2 Improve readability of set_callback(); add does_callback_own_cb_name().
  • 962ad0d set_callback(): Zero *src after copying to *dest to prevent potential double-free

File Changes

(9 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19831@github.com>

Christian Brabandt

unread,
Mar 26, 2026, 4:46:05 PM (13 hours ago) Mar 26
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19831)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19831/c4138094913@github.com>

Christian Brabandt

unread,
Mar 26, 2026, 4:57:10 PM (13 hours ago) Mar 26
to vim/vim, Subscribed

Closed #19831 via 02abcf3.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19831/issue_event/23949545644@github.com>

Reply all
Reply to author
Forward
0 new messages