[vim/vim] u_read_undo() leaks the file name when the undo file owner differs (PR #20987)

5 views
Skip to first unread message

Samuel Schlesinger

unread,
Aug 9, 2026, 4:57:17 PM (2 days ago) Aug 9
to vim/vim, Subscribed

Problem

When the owner of an undo file differs from the owner of the text file and
the current user, u_read_undo() returns without freeing the file name it
allocated with u_get_undo_file_name(). Every other exit frees it under
the "theend" label; this early return sits before the file pointer is
initialized, so it cannot use that label.

Solution

Free the file name before returning.

Noticed while reworking #20942; independent of that change, so sent
separately.

AI assistance is acknowledged with Co-Authored-By trailers on the commit,
per AGENTS.md.


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

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

Commit Summary

  • 8dd5988 u_read_undo() leaks the file name when the undo file owner differs

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/20987@github.com>

Christian Brabandt

unread,
Aug 10, 2026, 4:46:48 PM (19 hours ago) Aug 10
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20987)

thanks


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/20987/c5245768409@github.com>

Reply all
Reply to author
Forward
0 new messages