[vim/vim] getregionpos: fix double-free and unlink lists on alloc failure (PR #20744)

0 views
Skip to first unread message

mattn

unread,
Jul 10, 2026, 2:00:29 PM (yesterday) Jul 10
to vim/vim, Subscribed

add_regionpos_range() freed lists that were already linked into the result list when a later list_alloc() or list_append_list() failed, causing a double-free and use-after-free when the return value was later cleared. Only free lists that were not appended, and free them with list_free() so they are unlinked from the garbage-collection chain.

related: #20668


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

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

Commit Summary

  • 5cbd5d6 getregionpos: fix double-free and unlink lists on alloc 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/20744@github.com>

Reply all
Reply to author
Forward
0 new messages