mirror of
https://github.com/tmux/tmux.git
synced 2026-03-31 16:56:28 +00:00
Make paste_get_top return a copy of the buffer name which is more
sensible and avoids a double free pointed out by DongHan Kim.
This commit is contained in:
@@ -5052,9 +5052,9 @@ static void
|
||||
window_copy_append_selection(struct window_mode_entry *wme)
|
||||
{
|
||||
struct window_pane *wp = wme->wp;
|
||||
char *buf;
|
||||
char *buf, *bufname = NULL;
|
||||
struct paste_buffer *pb;
|
||||
const char *bufdata, *bufname = NULL;
|
||||
const char *bufdata;
|
||||
size_t len, bufsize;
|
||||
struct screen_write_ctx ctx;
|
||||
|
||||
@@ -5079,6 +5079,7 @@ window_copy_append_selection(struct window_mode_entry *wme)
|
||||
}
|
||||
if (paste_set(buf, len, bufname, NULL) != 0)
|
||||
free(buf);
|
||||
free(bufname);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user